Module: Segurocomar::Core::Insurance
- Included in:
- Api
- Defined in:
- lib/segurocomar/core/insurance.rb
Instance Method Summary collapse
- #get_insurer(id, insurable_kind) ⇒ Object
- #get_insurers(insurable_kind) ⇒ Object
- #get_product(id) ⇒ Object
- #get_products(args = {}) ⇒ Object
Instance Method Details
#get_insurer(id, insurable_kind) ⇒ Object
10 11 12 13 14 |
# File 'lib/segurocomar/core/insurance.rb', line 10 def get_insurer(id, insurable_kind) result = get_request("/insurers/#{id}", { insurable_kind: insurable_kind }) Segurocomar::Entity::Insurer.new(result[:body]) end |
#get_insurers(insurable_kind) ⇒ Object
4 5 6 7 8 |
# File 'lib/segurocomar/core/insurance.rb', line 4 def get_insurers(insurable_kind) results = get_request("/insurers", { insurable_kind: insurable_kind }) results[:body].map { |r| Segurocomar::Entity::Insurer.new(r) } end |
#get_product(id) ⇒ Object
22 23 24 25 26 |
# File 'lib/segurocomar/core/insurance.rb', line 22 def get_product(id) result = get_request("/products/#{id}") Segurocomar::Entity::Product.new(result[:body]) end |
#get_products(args = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/segurocomar/core/insurance.rb', line 16 def get_products(args={}) results = get_request("/products", args) results[:body].map { |r| Segurocomar::Entity::Product.new(r) } end |