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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77c6dd0ca4b290a80b560511885357622b2eda6f
|
4
|
+
data.tar.gz: f35fae62a36708d4c8286a4280498f55deecdaad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c251c81ca55c4b3b3d03b98c3db8cda13f8d523d0d3464e7a0d4d7d0e9f30bbacfe2fbb6439c62d608584a9e417d28ef64dbdbb4ed13b00f50b85dd42053a94
|
7
|
+
data.tar.gz: 082429460823c8dda793e4f132491af3a6f3f1da1c10962cbf7e96d499043dbe26d58d5024203bc3af7d132dd536da5c0ba78cde13bcec695c63dd0d20bf67ea
|
data/CHANGELOG.md
CHANGED
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/
|
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::
|
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::
|
40
|
+
Segurocomar::Entity::QuoteProduct.new(result[:body])
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Segurocomar
|
2
2
|
module Entity
|
3
|
-
class
|
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
|
data/lib/segurocomar/version.rb
CHANGED
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.
|
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-
|
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/
|
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
|