bigcartel 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module BigCartel
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/bigcartel.rb CHANGED
@@ -114,7 +114,7 @@ module BigCartel
114
114
  @tax = data['tax']
115
115
  @permalink = data['permalink']
116
116
  @images = data['images'].blank? ? [] : data['images'].map{|img| Image.new(img)}
117
- @shipping = data['shipping']
117
+ @shipping = data['shipping'].map{|ship| Shipping.new(ship)} unless data['shipping'].blank?
118
118
  end
119
119
 
120
120
  def img
@@ -139,5 +139,14 @@ module BigCartel
139
139
  @id = data['id']
140
140
  end
141
141
  end
142
-
142
+
143
+ class Shipping < Base
144
+ attr_reader :amount_alone, :amount_combined, :country
145
+ def initialize(data={})
146
+ @amount_alone = data['amount_alone']
147
+ @amount_combined = data['amount_with_others']
148
+ @country = data['country']['code'] unless data['country'].blank?
149
+ end
150
+ end
151
+
143
152
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Anderson
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-28 00:00:00 -06:00
17
+ date: 2011-01-31 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency