segurocomar 0.0.3 → 0.0.4

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: 13ec395b5133a88306691228f565dd645bcd03d9
4
- data.tar.gz: 3b22742367fca9b3903f8400865b1402e99f0387
3
+ metadata.gz: 0ee3db34e73804540a47795144912adcf453a1d0
4
+ data.tar.gz: b12746db45d617769a06ec3b9647bcfe82103c7f
5
5
  SHA512:
6
- metadata.gz: 2669505463836ec0a98c4a5e80686dd068fea96033e6f2124e4f00cba82b0db9b1d3fdd6f2cb6f094249e194c96a69339db898d9457087502b26478b9a63f55f
7
- data.tar.gz: 9a6e0b0a9f70c482ca6818becbb8eb96bada78ca24eec23f78c058e9ff2994b1eb84dc4b2768342534f381a7b56cac17b2229c3d8b694124cf1418aaa2e03277
6
+ metadata.gz: 050185ee7c11ffc489721f56b37172f62946941d0eb8d2521952baabba5498071a553a5a2034b035f19ef53e3f8d864d3b6e8fc3458dd9e8ce8fd1e18742afa8
7
+ data.tar.gz: 329d31a049833f59df33717c0b42bb13cdf80d3448663feebf9c7dba807d08a02c3c91736d8672b4ec1f655a87f2e3ee9da178da757463e9c465045b38916f8b
data/CHANGELOG.md CHANGED
@@ -9,3 +9,7 @@
9
9
  ## v0.0.3
10
10
 
11
11
  * Get slug of created quote
12
+
13
+ ## v0.0.4
14
+
15
+ * Get quote by code
@@ -7,6 +7,11 @@ module Segurocomar
7
7
  results[:body]
8
8
  end
9
9
 
10
+ def get_quote(quote_code)
11
+ result = get_request("/quotes/#{quote_code}")
12
+ Segurocomar::Entity::Quote.new(result)
13
+ end
14
+
10
15
  def calculate_product_prices(quote_id, product_ids)
11
16
  results = post_request("/quotes/#{quote_id}/calculate_product_prices", {
12
17
  product_ids: product_ids.join(',')
@@ -0,0 +1,22 @@
1
+ module Segurocomar
2
+ module Entity
3
+ class Quote
4
+ def self.attr_list
5
+ [:id, :code, :created_at, :insurable_kind_code, :quoted_products,
6
+ :quoted_insurable, :lead]
7
+ end
8
+
9
+ attr_reader *attr_list
10
+
11
+ def initialize(attributes={})
12
+ attributes.each do |k, v|
13
+ self.send("#{k}=", v) if self.respond_to?(k)
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ attr_writer *attr_list
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Segurocomar
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/segurocomar.rb CHANGED
@@ -13,6 +13,7 @@ require "segurocomar/entity/motorcycle"
13
13
  require "segurocomar/entity/motorcycle_brand"
14
14
  require "segurocomar/entity/product"
15
15
  require "segurocomar/entity/province"
16
+ require "segurocomar/entity/quote"
16
17
  require "segurocomar/entity/quoted_product"
17
18
  require "segurocomar/entity/truck"
18
19
  require "segurocomar/entity/truck_brand"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: segurocomar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
@@ -83,6 +83,7 @@ files:
83
83
  - lib/segurocomar/entity/motorcycle_brand.rb
84
84
  - lib/segurocomar/entity/product.rb
85
85
  - lib/segurocomar/entity/province.rb
86
+ - lib/segurocomar/entity/quote.rb
86
87
  - lib/segurocomar/entity/quoted_product.rb
87
88
  - lib/segurocomar/entity/truck.rb
88
89
  - lib/segurocomar/entity/truck_brand.rb