Its been a while
CI / scan_ruby (push) Failing after 2m13s
CI / lint (push) Failing after 20s

This commit is contained in:
Jason Jordan
2026-07-23 10:41:46 -04:00
parent 16fadfd529
commit 9853d58469
83 changed files with 1978 additions and 243 deletions
+41
View File
@@ -0,0 +1,41 @@
module MembersService
class IdCard
def initialize(member, layout)
@member = member
if @member.present?
@pb_entity_key = @member.pb_entity_key
@layout = layout
else
raise ArgumentError, "Member not found."
end
end
def call
url_components = {
host: ENV["BACLIGHT_SERVER_HOST"],
port: ENV["BACLIGHT_SERVER_PORT"],
path: "/api/v1/web_id_cards/member_card/#{@pb_entity_key}/#{@layout}"
}
response = HTTParty.get(
URI::HTTP.build(url_components),
headers: { 'Content-Type' => 'application/json', 'Accept' => 'application/pdf' },
stream_body: true
)
if response.code == 200
# content_disposition = response.headers['Content-Disposition']
# {
# pdf_file: response.body,
# filename: content_disposition[/filename="?([^"]*)"?/, 1]
# }
response
else
nil
end
end
end
end