Class: AlfaInsurance::CreateResponse
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/create_response.rb', line 7
def cost
Money.from_amount(body.dig(:calculation_result, :premium).to_f, currency)
end
|
#insurance_id ⇒ Object
3
4
5
|
# File 'lib/alfa_insurance/create_response.rb', line 3
def insurance_id
body[:policy_id].to_i
end
|
#risk_type ⇒ Object
15
16
17
|
# File 'lib/alfa_insurance/create_response.rb', line 15
def risk_type
body.dig(:calculation_result, :risk_value, :@risk_type)
end
|
#risk_value ⇒ Object
11
12
13
|
# File 'lib/alfa_insurance/create_response.rb', line 11
def risk_value
Money.from_amount(body.dig(:calculation_result, :risk_value_sum).to_f, currency)
end
|