lib/lce/order.rb in lce-0.0.3 vs lib/lce/order.rb in lce-0.0.4
- old
+ new
@@ -27,13 +27,22 @@
def find(id)
response = Lce.client.get('orders', id)
new(response)
end
+ def labels_for(id)
+ order = new(id: id)
+ order.labels
+ end
+
+ def tracking_for(id)
+ order = new(id: id)
+ order.tracking
+ end
end
def labels
- @labels ||= Lce.client.get('orders', id, 'labels', 'pdf')
+ @labels ||= Lce.client.get('orders', id, 'labels', 'pdf')
end
def write_labels(name = nil)
name = (name.is_a?(String)) ? name : "labels-#{id}.pdf"
File.open(name, "wb") do |f|