segurocomar 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d8b162b0fc5f20a33cfe4ed1c8b838331732546
4
- data.tar.gz: 03bd038d74eb694c9b3153f5e130e6689113c579
3
+ metadata.gz: 77c6dd0ca4b290a80b560511885357622b2eda6f
4
+ data.tar.gz: f35fae62a36708d4c8286a4280498f55deecdaad
5
5
  SHA512:
6
- metadata.gz: 6dbe272b89c95b0490b88ab884028d21af159f0558a0f4bec564c69f289ecbd38a8d849a10068926d1c711d9d4d9c3b77e5234d7635da7c44673e932b302f540
7
- data.tar.gz: 3761713a5f1cf80cd06630a33117506040d0d72b676280d2ef3cf302f1cffbe348b7e42f6dd88d0a0f550494a312e3a1471acc34ec9036ae54c96cecc079552b
6
+ metadata.gz: 5c251c81ca55c4b3b3d03b98c3db8cda13f8d523d0d3464e7a0d4d7d0e9f30bbacfe2fbb6439c62d608584a9e417d28ef64dbdbb4ed13b00f50b85dd42053a94
7
+ data.tar.gz: 082429460823c8dda793e4f132491af3a6f3f1da1c10962cbf7e96d499043dbe26d58d5024203bc3af7d132dd536da5c0ba78cde13bcec695c63dd0d20bf67ea
data/CHANGELOG.md CHANGED
@@ -49,3 +49,7 @@
49
49
  ## v0.1.6
50
50
 
51
51
  * Bugfix to get ad campaign
52
+
53
+ ## v0.2.0
54
+
55
+ * Added method to get quote products
data/lib/segurocomar.rb CHANGED
@@ -15,7 +15,7 @@ require "segurocomar/entity/motorcycle_brand"
15
15
  require "segurocomar/entity/product"
16
16
  require "segurocomar/entity/province"
17
17
  require "segurocomar/entity/quote"
18
- require "segurocomar/entity/quoted_product"
18
+ require "segurocomar/entity/quote_product"
19
19
  require "segurocomar/entity/truck"
20
20
  require "segurocomar/entity/truck_brand"
21
21
 
@@ -18,18 +18,26 @@ module Segurocomar
18
18
  results[:body].map { |r| Segurocomar::Entity::Insurer.new(r) }
19
19
  end
20
20
 
21
+ def get_quote_products(quote_code, product_ids=nil)
22
+ results = get_request("/quotes/#{quote_id}/quote_products", {
23
+ product_ids: product_ids.join(',')
24
+ })
25
+
26
+ results[:body].map { |r| Segurocomar::Entity::QuoteProduct.new(r) }
27
+ end
28
+
21
29
  def calculate_product_prices(quote_id, product_ids)
22
30
  results = post_request("/quotes/#{quote_id}/calculate_product_prices", {
23
31
  product_ids: product_ids.join(',')
24
32
  })
25
33
 
26
- results[:body].map { |r| Segurocomar::Entity::QuotedProduct.new(r) }
34
+ results[:body].map { |r| Segurocomar::Entity::QuoteProduct.new(r) }
27
35
  end
28
36
 
29
37
  def hire_quoted_product(quote_id, product_id)
30
38
  result = post_request("/quotes/#{quote_id}/hire_product/#{product_id}")
31
39
 
32
- Segurocomar::Entity::QuotedProduct.new(result[:body])
40
+ Segurocomar::Entity::QuoteProduct.new(result[:body])
33
41
  end
34
42
  end
35
43
  end
@@ -3,7 +3,7 @@ module Segurocomar
3
3
  class Quote
4
4
  def self.attr_list
5
5
  [:id, :code, :created_at, :insurable_kind_code,
6
- :quoted_products, :quoted_insurable, :lead,
6
+ :quote_products, :quoted_insurable, :lead,
7
7
  :referral_code, :ad_campaign]
8
8
  end
9
9
 
@@ -1,9 +1,9 @@
1
1
  module Segurocomar
2
2
  module Entity
3
- class QuotedProduct
3
+ class QuoteProduct
4
4
  def self.attr_list
5
5
  [:id, :product_id, :product_name, :insurer_id, :insurer_name,
6
- :price, :price_from, :hired, :extra_params]
6
+ :price, :price_from, :hired, :extra_params, :available, :relative_quotient]
7
7
  end
8
8
 
9
9
  attr_reader *attr_list
@@ -1,3 +1,3 @@
1
1
  module Segurocomar
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: segurocomar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,7 +86,7 @@ files:
86
86
  - lib/segurocomar/entity/product.rb
87
87
  - lib/segurocomar/entity/province.rb
88
88
  - lib/segurocomar/entity/quote.rb
89
- - lib/segurocomar/entity/quoted_product.rb
89
+ - lib/segurocomar/entity/quote_product.rb
90
90
  - lib/segurocomar/entity/truck.rb
91
91
  - lib/segurocomar/entity/truck_brand.rb
92
92
  - lib/segurocomar/version.rb