mercadolibre 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fa9ac2b080b96683d4470b931fd3f1a80f359ce
4
- data.tar.gz: 1a657d36e8aa06e678222e289ce359ed557ccdfc
3
+ metadata.gz: 406ebc5a34e1f6ee461dd933317e025274fda3eb
4
+ data.tar.gz: 6c3f16b2f13306170597178e3e1f16274335a4b0
5
5
  SHA512:
6
- metadata.gz: 1c2de29664c58e8f80b9fea47e8610020feb19012d8c7d10218a23f50a2fe1af3434dbf8294db631f3e941cf2f9f7fc26e5abf64934526a5228f0f3b110e30f9
7
- data.tar.gz: 9b7a2f88b310d80843981ec82f9b04fcf48683f9d744d7631dffd978fb60e3836ae8ff1081950516290495a9a777e921f3daf57c06dd553cbd3a00c5753c9f70
6
+ metadata.gz: 638d71987adf791e971c62c0e0ebbf329a22bd61817a22daf9314bb38c35969f4d694d4d12650b2e1e31db7bc72673d006018e2f0852dd7230e2eca6a74d28b2
7
+ data.tar.gz: bcdb6ab20a15ab15165ec564901a0a4bd44b701a3db11741ee2434c94e8ab4afc7a6d2e88a0abe35b29bdb56c7cb8d4ac93cda22a9e048fda6779d5ddc280b07
data/CHANGELOG.md CHANGED
@@ -73,3 +73,7 @@
73
73
  ## v0.3.0
74
74
 
75
75
  * Refactored orders and shippings
76
+
77
+ ## v0.3.1
78
+
79
+ * Bugfix on nil values cases
@@ -11,11 +11,11 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'state'
14
- self.state = State.new(v)
14
+ self.state = State.new(v) unless v.nil?
15
15
  elsif k.to_s == 'city'
16
- self.city = City.new(v)
16
+ self.city = City.new(v) unless v.nil?
17
17
  elsif k.to_s == 'country'
18
- self.country = Country.new(v)
18
+ self.country = Country.new(v) unless v.nil?
19
19
  else
20
20
  self.send("#{k}=", v) if self.respond_to?(k)
21
21
  end
@@ -10,7 +10,7 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'date_created'
13
- self.date_created = Time.parse(v)
13
+ self.date_created = Time.parse(v) unless v.nil?
14
14
  else
15
15
  self.send("#{k}=", v) if self.respond_to?(k)
16
16
  end
@@ -11,9 +11,9 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if ['path_from_root', 'children_categories'].include?(k.to_s)
14
- self.state = v.map { |x| Category.new(x) }
14
+ self.state = v.map { |x| Category.new(x) } unless v.nil?
15
15
  elsif k.to_s == 'settings'
16
- self.settings = CategorySettings.new(v)
16
+ self.settings = CategorySettings.new(v) unless v.nil?
17
17
  else
18
18
  self.send("#{k}=", v) if self.respond_to?(k)
19
19
  end
@@ -10,9 +10,9 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'state'
13
- self.state = State.new(v)
13
+ self.state = State.new(v) unless v.nil?
14
14
  elsif k.to_s == 'country'
15
- self.country = Country.new(v)
15
+ self.country = Country.new(v) unless v.nil?
16
16
  else
17
17
  self.send("#{k}=", v) if self.respond_to?(k)
18
18
  end
@@ -11,7 +11,7 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'states'
14
- self.states = v.map { |x| State.new(x) }
14
+ self.states = v.map { |x| State.new(x) } unless v.nil?
15
15
  else
16
16
  self.send("#{k}=", v) if self.respond_to?(k)
17
17
  end
@@ -11,7 +11,7 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'picture'
14
- self.picture = ItemPicture.new(v)
14
+ self.picture = ItemPicture.new(v) unless v.nil?
15
15
  else
16
16
  self.send("#{k}=", v) if self.respond_to?(k)
17
17
  end
@@ -10,7 +10,7 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'date_created'
13
- self.date_created = Time.parse(v)
13
+ self.date_created = Time.parse(v) unless v.nil?
14
14
  else
15
15
  self.send("#{k}=", v) if self.respond_to?(k)
16
16
  end
@@ -14,7 +14,7 @@ module Mercadolibre
14
14
  def initialize(attributes={})
15
15
  attributes.each do |k, v|
16
16
  if k.to_s == 'pictures'
17
- self.pictures = v.map { |x| ItemPicture.new(x) }
17
+ self.pictures = v.map { |x| ItemPicture.new(x) } unless v.nil?
18
18
  elsif ['stop_time', 'last_updated', 'start_time', 'date_created'].include?(k.to_s)
19
19
  self.send("#{k}=", Time.parse(v)) unless v.nil?
20
20
  else
@@ -11,7 +11,7 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'stop_time'
14
- self.stop_time = Time.parse(v)
14
+ self.stop_time = Time.parse(v) unless v.nil?
15
15
  else
16
16
  self.send("#{k}=", v) if self.respond_to?(k)
17
17
  end
@@ -13,15 +13,15 @@ module Mercadolibre
13
13
  def initialize(attributes={})
14
14
  attributes.each do |k, v|
15
15
  if k.to_s == 'order_items'
16
- self.order_items = v.map { |x| OrderItem.new(x) }
16
+ self.order_items = v.map { |x| OrderItem.new(x) } unless v.nil?
17
17
  elsif k.to_s == 'payments'
18
- self.payments = v.map { |x| Payment.new(x) }
18
+ self.payments = v.map { |x| Payment.new(x) } unless v.nil?
19
19
  elsif k.to_s == 'feedback'
20
- self.feedback = OrderFeedback.new(v)
20
+ self.feedback = OrderFeedback.new(v) unless v.nil?
21
21
  elsif k.to_s == 'shipping'
22
- self.shipping = OrderShipping.new(v)
22
+ self.shipping = OrderShipping.new(v) unless v.nil?
23
23
  elsif k.to_s == 'coupon'
24
- self.coupon = OrderCoupon.new(v)
24
+ self.coupon = OrderCoupon.new(v) unless v.nil?
25
25
  elsif ['buyer', 'seller'].include?(k.to_s)
26
26
  self.send("#{k}=", User.new(v)) unless v.nil?
27
27
  elsif ['date_created', 'date_closed', 'last_updated'].include?(k.to_s)
@@ -10,7 +10,7 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'item'
13
- self.item = Item.new(v)
13
+ self.item = Item.new(v) unless v.nil?
14
14
  else
15
15
  self.send("#{k}=", v) if self.respond_to?(k)
16
16
  end
@@ -12,11 +12,11 @@ module Mercadolibre
12
12
  def initialize(attributes={})
13
13
  attributes.each do |k, v|
14
14
  if k.to_s == 'shipping_option'
15
- self.shipping_option = ShippingOption.new(v)
15
+ self.shipping_option = ShippingOption.new(v) unless v.nil?
16
16
  elsif k.to_s == 'shipping_items'
17
- self.shipping_items = v.map { |x| ShippingItem.new(x) }
17
+ self.shipping_items = v.map { |x| ShippingItem.new(x) } unless v.nil?
18
18
  elsif k.to_s == 'receiver_address'
19
- self.receiver_address = Address.new(v)
19
+ self.receiver_address = Address.new(v) unless v.nil?
20
20
  elsif ['date_first_printed', 'date_created'].include?(k.to_s)
21
21
  self.send("#{k}=", Time.parse(v)) unless v.nil?
22
22
  else
@@ -12,13 +12,13 @@ module Mercadolibre
12
12
  def initialize(attributes={})
13
13
  attributes.each do |k, v|
14
14
  if k.to_s == 'card_issuer'
15
- self.card_issuer = CardIssuer.new(v)
15
+ self.card_issuer = CardIssuer.new(v) unless v.nil?
16
16
  elsif k.to_s == 'payer_costs'
17
- self.payer_costs = v.map { |x| PaymentPlan.new(x) }
17
+ self.payer_costs = v.map { |x| PaymentPlan.new(x) } unless v.nil?
18
18
  elsif k.to_s == 'exceptions_by_card_issuer'
19
- self.exceptions_by_card_issuer = v.map { |x| PaymentPromotion.new(x) }
19
+ self.exceptions_by_card_issuer = v.map { |x| PaymentPromotion.new(x) } unless v.nil?
20
20
  elsif k.to_s == 'card_configuration'
21
- self.card_configuration = v.map { |x| CardConfiguration.new(x) }
21
+ self.card_configuration = v.map { |x| CardConfiguration.new(x) } unless v.nil?
22
22
  else
23
23
  self.send("#{k}=", v) if self.respond_to?(k)
24
24
  end
@@ -11,9 +11,9 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'card_issuer'
14
- self.card_issuer = CardIssuer.new(v)
14
+ self.card_issuer = CardIssuer.new(v) unless v.nil?
15
15
  elsif k.to_s == 'payer_costs'
16
- self.payer_costs = v.map { |x| PaymentPlan.new(x) }
16
+ self.payer_costs = v.map { |x| PaymentPlan.new(x) } unless v.nil?
17
17
  else
18
18
  self.send("#{k}=", v) if self.respond_to?(k)
19
19
  end
@@ -15,7 +15,7 @@ module Mercadolibre
15
15
  elsif k.to_s == 'from'
16
16
  self.user_id = v['id'] unless v.nil?
17
17
  elsif k.to_s == 'date_created'
18
- self.date_created = Time.parse(v)
18
+ self.date_created = Time.parse(v) unless v.nil?
19
19
  else
20
20
  self.send("#{k}=", v) if self.respond_to?(k)
21
21
  end
@@ -11,9 +11,9 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'speed'
14
- self.speed = ShippingSpeed.new(v)
14
+ self.speed = ShippingSpeed.new(v) unless v.nil?
15
15
  elsif k.to_s == 'estimated_delivery'
16
- self.estimated_delivery = ShippingDelivery.new(v)
16
+ self.estimated_delivery = ShippingDelivery.new(v) unless v.nil?
17
17
  else
18
18
  self.send("#{k}=", v) if self.respond_to?(k)
19
19
  end
@@ -11,9 +11,9 @@ module Mercadolibre
11
11
  def initialize(attributes={})
12
12
  attributes.each do |k, v|
13
13
  if k.to_s == 'currencies'
14
- self.states = v.map { |x| Currency.new(x) }
14
+ self.states = v.map { |x| Currency.new(x) } unless v.nil?
15
15
  elsif k.to_s == 'categories'
16
- self.categories = v.map { |x| Category.new(x) }
16
+ self.categories = v.map { |x| Category.new(x) } unless v.nil?
17
17
  else
18
18
  self.send("#{k}=", v) if self.respond_to?(k)
19
19
  end
@@ -10,9 +10,9 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'cities'
13
- self.cities = v.map { |x| City.new(x) }
13
+ self.cities = v.map { |x| City.new(x) } unless v.nil?
14
14
  elsif k.to_s == 'country'
15
- self.country = Country.new(v)
15
+ self.country = Country.new(v) unless v.nil?
16
16
  else
17
17
  self.send("#{k}=", v) if self.respond_to?(k)
18
18
  end
@@ -12,13 +12,13 @@ module Mercadolibre
12
12
  def initialize(attributes={})
13
13
  attributes.each do |k, v|
14
14
  if k.to_s == 'registration_date'
15
- self.registration_date = Time.parse(v)
15
+ self.registration_date = Time.parse(v) unless v.nil?
16
16
  elsif k.to_s == 'phone'
17
- self.phone = Phone.new(v)
17
+ self.phone = Phone.new(v) unless v.nil?
18
18
  elsif k.to_s == 'alternative_phone'
19
- self.alternative_phone = Phone.new(v)
19
+ self.alternative_phone = Phone.new(v) unless v.nil?
20
20
  elsif k.to_s == 'billing_info'
21
- self.billing_info = BillingInfo.new(v)
21
+ self.billing_info = BillingInfo.new(v) unless v.nil?
22
22
  else
23
23
  self.send("#{k}=", v) if self.respond_to?(k)
24
24
  end
@@ -10,11 +10,11 @@ module Mercadolibre
10
10
  def initialize(attributes={})
11
11
  attributes.each do |k, v|
12
12
  if k.to_s == 'state'
13
- self.state = State.new(v)
13
+ self.state = State.new(v) unless v.nil?
14
14
  elsif k.to_s == 'country'
15
- self.country = Country.new(v)
15
+ self.country = Country.new(v) unless v.nil?
16
16
  elsif k.to_s == 'city'
17
- self.country = City.new(v)
17
+ self.country = City.new(v) unless v.nil?
18
18
  else
19
19
  self.send("#{k}=", v) if self.respond_to?(k)
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Mercadolibre
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercadolibre
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler