Class: Bigid::Bgcheck::Request

Inherits:
Auth::AuthenticatedResource
  • Object
show all
Defined in:
lib/bigid/bgcheck/request.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(document:, document_type:, group:) ⇒ Object



15
16
17
# File 'lib/bigid/bgcheck/request.rb', line 15

def self.call(document:, document_type:, group:)
  new.call(document: document, document_type: document_type, group: group)
end

Instance Method Details

#call(document:, document_type:, group:) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/bigid/bgcheck/request.rb', line 6

def call(document:, document_type:, group:)
  res = @connection.post(url: Bigid::Bgcheck::SRV_ENDPOINT,
                         body: payload(document, document_type, group).to_json)

  check_status(res.status)

  parse_response_body(res.body)
end