Class: Fountain::Papi::Applicant::CreateStatus
- Inherits:
-
Object
- Object
- Fountain::Papi::Applicant::CreateStatus
- Defined in:
- lib/fountain/papi/applicant/create_status.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #call ⇒ Object
- #created_status(response) ⇒ Object
-
#initialize(params) ⇒ CreateStatus
constructor
A new instance of CreateStatus.
Constructor Details
#initialize(params) ⇒ CreateStatus
Returns a new instance of CreateStatus.
13 14 15 |
# File 'lib/fountain/papi/applicant/create_status.rb', line 13 def initialize(params) @status = Fountain::Papi::Applicant::Status.new(params) end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/fountain/papi/applicant/create_status.rb', line 11 def status @status end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fountain/papi/applicant/create_status.rb', line 17 def call uri = Fountain::Papi.config.base_uri(override_partner_id: status.partner_id) response = Client.post( "#{uri}/applicants/#{status.applicant_id}/status", body: { applicant: { partner_status: status } }.to_json, headers: Fountain::Papi.config.headers ) raise Fountain::Papi::Error, response unless response.success? created_status(response) end |