lib/chord.rb in chord-0.0.10 vs lib/chord.rb in chord-0.0.11
- old
+ new
@@ -191,10 +191,14 @@
def self.id_attribute
'number'
end
+ def line_items
+ @attributes['line_items'].map{ |i| LineItem.new(i['id'], i) }
+ end
+
def complete?
state == 'complete'
end
def user
@@ -220,9 +224,17 @@
end
def subscription_start?
expand! unless attributes.include?('subscription_in_cart')
subscription_in_cart
+ end
+ end
+
+
+ class LineItem < Base
+
+ def subscription?
+ subscription_line_items.size > 0
end
end
class Role < Base