Class: AlfaInsurance::FindResponse
Instance Method Summary
collapse
Methods inherited from Response
#body, #error_code, #error_description, #initialize, #success?
Instance Method Details
#cost ⇒ Object
7
8
9
|
# File 'lib/alfa_insurance/find_response.rb', line 7
def cost
Money.from_amount(body.dig(:policy_information, :rate).to_f, currency)
end
|
#insurance_id ⇒ Object
3
4
5
|
# File 'lib/alfa_insurance/find_response.rb', line 3
def insurance_id
body.dig(:policy_information, :policy_id).to_i
end
|
#risk_type ⇒ Object
15
16
17
|
# File 'lib/alfa_insurance/find_response.rb', line 15
def risk_type
body.dig(:policy_information, :risk_value, :@risk_type)
end
|
#risk_value ⇒ Object
11
12
13
|
# File 'lib/alfa_insurance/find_response.rb', line 11
def risk_value
Money.from_amount(body.dig(:policy_information, :risk_value, :@value).to_f, risk_currency)
end
|
#state ⇒ Object
19
20
21
|
# File 'lib/alfa_insurance/find_response.rb', line 19
def state
body.dig(:policy_information, :policy_status)
end
|