mercadolibre 0.5.2 → 0.6.0

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: 3e8bf2e14ad7010294be1ce17b3fffc76a66e5eb
4
- data.tar.gz: bcf0e017bf293c2764aa7f61b1e1e9afc705fa13
3
+ metadata.gz: 060b8190d10f5c0b9d64f50407ed17d9181b2d2d
4
+ data.tar.gz: f94a830f7026fe5d74f3def6235cf33553ffe2c2
5
5
  SHA512:
6
- metadata.gz: 3f99dfbdd63a70c4a5e6bbaa5f822b19cebadfd2e5cab1c36f6c3d24154c65d82fa556be593d56a0343c312dca55d806113ca2abab06000d34fd4d71d9d159a1
7
- data.tar.gz: a4e09907f763c32e53abdd2f1a3ab75605a3dbbd50e20d1d60511439911cb678d4c9c0e1f29172583aacb5b0213a85eab37809c03c7a61931ef53aa9130337ee
6
+ metadata.gz: 37d02f79335fd46ec0909cd220472b52ed2021eb0aed5d743a149a9ecb9db82ec18ac41e54fa91925766b2df7cafd71387cb3f313a5f1d9c18f7ca947a5706ca
7
+ data.tar.gz: 1555eff5d6698fcda868fbe876ab3f5d2dd71af4415b6126a5dba8981fa82ae9c108ae0fda41c0ff901abcc9f9187e1884efb6abbb98b3fde0181974c8f95a0f
data/CHANGELOG.md CHANGED
@@ -117,3 +117,7 @@
117
117
  ## v0.5.2
118
118
 
119
119
  * Added update shipment method
120
+
121
+ ## v0.6.0
122
+
123
+ * Added new item attributes
@@ -4,7 +4,8 @@ module Mercadolibre
4
4
  def self.attr_list
5
5
  [:country, :state, :city, :neighborhood, :municipality, :types, :street_name,
6
6
  :address_line, :id, :zip_code, :longitude, :street_number, :latitude, :comment,
7
- :latitude, :longitude, :geolocation_type, :agency, :is_valid_for_carrier]
7
+ :latitude, :longitude, :geolocation_type, :agency, :is_valid_for_carrier,
8
+ :search_location]
8
9
  end
9
10
 
10
11
  attr_reader *attr_list
@@ -23,6 +24,8 @@ module Mercadolibre
23
24
  self.municipality = Municipality.new(v) unless v.nil?
24
25
  elsif k.to_s == 'agency'
25
26
  self.agency = AddressAgency.new(v) unless v.nil?
27
+ elsif k.to_s == 'search_location'
28
+ self.search_location = SearchLocation.new(v) unless v.nil?
26
29
  else
27
30
  self.send("#{k}=", v) if self.respond_to?(k)
28
31
  end
@@ -0,0 +1,21 @@
1
+ module Mercadolibre
2
+ module Entity
3
+ class Geolocation
4
+ def self.attr_list
5
+ [:latitude, :longitude]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ self.send("#{k}=", v) if self.respond_to?(k)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ attr_writer *attr_list
19
+ end
20
+ end
21
+ end
@@ -2,11 +2,15 @@ module Mercadolibre
2
2
  module Entity
3
3
  class Item
4
4
  def self.attr_list
5
- [:id, :site_id, :title, :subtitle, :seller_id, :category_id, :price,
6
- :base_price, :currency_id, :initial_quantity, :available_quantity, :sold_quantity,
7
- :buying_mode, :listing_type_id, :start_time, :stop_time, :condition, :permalink,
8
- :thumbnail, :secure_thumbnail, :pictures, :status, :sub_status, :parent_item_id,
9
- :automatic_relist, :date_created, :last_updated, :variation_id, :variation_attributes]
5
+ [:id, :site_id, :title, :subtitle, :seller_id, :category_id, :official_store_id,
6
+ :price, :base_price, :original_price, :currency_id, :initial_quantity, :available_quantity,
7
+ :sold_quantity, :buying_mode, :listing_type_id, :start_time, :stop_time, :condition, :permalink,
8
+ :thumbnail, :secure_thumbnail, :pictures, :video_id, :descriptions, :accepts_mercadopago,
9
+ :non_mercado_pago_payment_methods, :shipping, :seller_address, :seller_contact, :location,
10
+ :geolocation, :coverage_areas, :attributes, :listing_source, :variations, :status, :sub_status,
11
+ :tags, :warranty, :catalog_product_id, :parent_item_id, :differential_pricing, :deal_ids,
12
+ :automatic_relist, :date_created, :last_updated
13
+ ]
10
14
  end
11
15
 
12
16
  attr_reader *attr_list
@@ -15,6 +19,16 @@ module Mercadolibre
15
19
  attributes.each do |k, v|
16
20
  if k.to_s == 'pictures'
17
21
  self.pictures = v.map { |x| ItemPicture.new(x) } unless v.nil?
22
+ elsif k.to_s == 'descriptions'
23
+ self.descriptions = v.map { |x| ItemDescription.new(x) } unless v.nil?
24
+ elsif k.to_s == 'non_mercado_pago_payment_methods'
25
+ self.non_mercado_pago_payment_methods = v.map { |x| ItemPaymentMethod.new(x) } unless v.nil?
26
+ elsif k.to_s == 'shipping'
27
+ self.shipping = ItemShipping.new(v)
28
+ elsif k.to_s == 'seller_address'
29
+ self.seller_address = Address.new(v)
30
+ elsif k.to_s == 'geolocation'
31
+ self.geolocation = Geolocation.new(v)
18
32
  elsif ['stop_time', 'last_updated', 'start_time', 'date_created'].include?(k.to_s)
19
33
  self.send("#{k}=", Time.parse(v)) unless v.nil?
20
34
  else
@@ -0,0 +1,21 @@
1
+ module Mercadolibre
2
+ module Entity
3
+ class ItemPaymentMethod
4
+ def self.attr_list
5
+ [:id, :description, :type]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ self.send("#{k}=", v) if self.respond_to?(k)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ attr_writer *attr_list
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Mercadolibre
2
+ module Entity
3
+ class ItemShipping
4
+ def self.attr_list
5
+ [:mode, :local_pick_up, :free_shipping, :dimensions, :tags]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ self.send("#{k}=", v) if self.respond_to?(k)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ attr_writer *attr_list
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ module Mercadolibre
2
+ module Entity
3
+ class SearchLocation
4
+ def self.attr_list
5
+ [:neighborhood, :city, :state]
6
+ end
7
+
8
+ attr_reader *attr_list
9
+
10
+ def initialize(attributes={})
11
+ attributes.each do |k, v|
12
+ if k.to_s == 'state'
13
+ self.state = State.new(v) unless v.nil?
14
+ elsif k.to_s == 'city'
15
+ self.city = City.new(v) unless v.nil?
16
+ elsif k.to_s == 'neighborhood'
17
+ self.neighborhood = Neighborhood.new(v) unless v.nil?
18
+ end
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_writer *attr_list
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Mercadolibre
2
- VERSION = "0.5.2"
2
+ VERSION = "0.6.0"
3
3
  end
data/lib/mercadolibre.rb CHANGED
@@ -20,9 +20,12 @@ require "mercadolibre/entity/currency_conversion_ratio"
20
20
  require "mercadolibre/entity/featured_item"
21
21
  require "mercadolibre/entity/feedback"
22
22
  require "mercadolibre/entity/feedback_reply"
23
+ require "mercadolibre/entity/geolocation"
23
24
  require "mercadolibre/entity/item"
24
25
  require "mercadolibre/entity/item_description"
26
+ require "mercadolibre/entity/item_payment_method"
25
27
  require "mercadolibre/entity/item_picture"
28
+ require "mercadolibre/entity/item_shipping"
26
29
  require "mercadolibre/entity/listing_exposure"
27
30
  require "mercadolibre/entity/listing_price"
28
31
  require "mercadolibre/entity/listing_type"
@@ -40,6 +43,7 @@ require "mercadolibre/entity/payment_plan"
40
43
  require "mercadolibre/entity/payment_promotion"
41
44
  require "mercadolibre/entity/phone"
42
45
  require "mercadolibre/entity/question"
46
+ require "mercadolibre/entity/search_location"
43
47
  require "mercadolibre/entity/shipment"
44
48
  require "mercadolibre/entity/shipment_status_history"
45
49
  require "mercadolibre/entity/shipping_delivery"
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.5.2
4
+ version: 0.6.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: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,9 +91,12 @@ files:
91
91
  - lib/mercadolibre/entity/featured_item.rb
92
92
  - lib/mercadolibre/entity/feedback.rb
93
93
  - lib/mercadolibre/entity/feedback_reply.rb
94
+ - lib/mercadolibre/entity/geolocation.rb
94
95
  - lib/mercadolibre/entity/item.rb
95
96
  - lib/mercadolibre/entity/item_description.rb
97
+ - lib/mercadolibre/entity/item_payment_method.rb
96
98
  - lib/mercadolibre/entity/item_picture.rb
99
+ - lib/mercadolibre/entity/item_shipping.rb
97
100
  - lib/mercadolibre/entity/listing_exposure.rb
98
101
  - lib/mercadolibre/entity/listing_price.rb
99
102
  - lib/mercadolibre/entity/listing_type.rb
@@ -111,6 +114,7 @@ files:
111
114
  - lib/mercadolibre/entity/payment_promotion.rb
112
115
  - lib/mercadolibre/entity/phone.rb
113
116
  - lib/mercadolibre/entity/question.rb
117
+ - lib/mercadolibre/entity/search_location.rb
114
118
  - lib/mercadolibre/entity/shipment.rb
115
119
  - lib/mercadolibre/entity/shipment_status_history.rb
116
120
  - lib/mercadolibre/entity/shipping_delivery.rb
@@ -144,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
148
  version: '0'
145
149
  requirements: []
146
150
  rubyforge_project:
147
- rubygems_version: 2.2.2
151
+ rubygems_version: 2.2.3
148
152
  signing_key:
149
153
  specification_version: 4
150
154
  summary: Connect to Mercadolibre through Meli API