Class: Mollie::Order::Line
Instance Attribute Summary collapse
-
#_links ⇒ Object
(also: #links)
Returns the value of attribute _links.
-
#amount_canceled ⇒ Object
Returns the value of attribute amount_canceled.
-
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
-
#amount_shipped ⇒ Object
Returns the value of attribute amount_shipped.
-
#cancelable_quantity ⇒ Object
Returns the value of attribute cancelable_quantity.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_cancelable ⇒ Object
Returns the value of attribute is_cancelable.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#quantity_canceled ⇒ Object
Returns the value of attribute quantity_canceled.
-
#quantity_refunded ⇒ Object
Returns the value of attribute quantity_refunded.
-
#quantity_shipped ⇒ Object
Returns the value of attribute quantity_shipped.
-
#refundable_quantity ⇒ Object
Returns the value of attribute refundable_quantity.
-
#shippable_quantity ⇒ Object
Returns the value of attribute shippable_quantity.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#status ⇒ Object
Returns the value of attribute status.
-
#total_amount ⇒ Object
Returns the value of attribute total_amount.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unit_price ⇒ Object
Returns the value of attribute unit_price.
-
#vat_amount ⇒ Object
Returns the value of attribute vat_amount.
-
#vat_rate ⇒ Object
Returns the value of attribute vat_rate.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #cancel(options = {}) ⇒ Object
- #cancelable? ⇒ Boolean
- #discounted? ⇒ Boolean
- #image_url ⇒ Object
- #product_url ⇒ Object
- #refundable? ⇒ Boolean
- #shippable? ⇒ Boolean
Methods inherited from Base
all, #assign_attributes, cancel, create, #delete, delete, get, id_param, #initialize, parent_id, request, resource_name, #update
Constructor Details
This class inherits a constructor from Mollie::Base
Instance Attribute Details
#_links ⇒ Object Also known as: links
Returns the value of attribute _links.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def _links @_links end |
#amount_canceled ⇒ Object
Returns the value of attribute amount_canceled.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def amount_canceled @amount_canceled end |
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def amount_refunded @amount_refunded end |
#amount_shipped ⇒ Object
Returns the value of attribute amount_shipped.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def amount_shipped @amount_shipped end |
#cancelable_quantity ⇒ Object
Returns the value of attribute cancelable_quantity.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def cancelable_quantity @cancelable_quantity end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def created_at @created_at end |
#discount_amount ⇒ Object
Returns the value of attribute discount_amount.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def discount_amount @discount_amount end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def id @id end |
#is_cancelable ⇒ Object
Returns the value of attribute is_cancelable.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def is_cancelable @is_cancelable end |
#metadata ⇒ Object
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def name @name end |
#order_id ⇒ Object
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def order_id @order_id end |
#quantity ⇒ Object
Returns the value of attribute quantity.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def quantity @quantity end |
#quantity_canceled ⇒ Object
Returns the value of attribute quantity_canceled.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def quantity_canceled @quantity_canceled end |
#quantity_refunded ⇒ Object
Returns the value of attribute quantity_refunded.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def quantity_refunded @quantity_refunded end |
#quantity_shipped ⇒ Object
Returns the value of attribute quantity_shipped.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def quantity_shipped @quantity_shipped end |
#refundable_quantity ⇒ Object
Returns the value of attribute refundable_quantity.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def refundable_quantity @refundable_quantity end |
#shippable_quantity ⇒ Object
Returns the value of attribute shippable_quantity.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def shippable_quantity @shippable_quantity end |
#sku ⇒ Object
Returns the value of attribute sku.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def sku @sku end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def status @status end |
#total_amount ⇒ Object
Returns the value of attribute total_amount.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def total_amount @total_amount end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def type @type end |
#unit_price ⇒ Object
Returns the value of attribute unit_price.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def unit_price @unit_price end |
#vat_amount ⇒ Object
Returns the value of attribute vat_amount.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def vat_amount @vat_amount end |
#vat_rate ⇒ Object
Returns the value of attribute vat_rate.
4 5 6 |
# File 'lib/mollie/order/line.rb', line 4 def vat_rate @vat_rate end |
Class Method Details
Instance Method Details
#cancel(options = {}) ⇒ Object
96 97 98 99 100 101 |
# File 'lib/mollie/order/line.rb', line 96 def cancel( = {}) qty = .delete(:quantity) || quantity [:lines] = [{ id: id, quantity: qty }] [:order_id] = order_id Mollie::Order::Line.delete(nil, ) end |
#cancelable? ⇒ Boolean
36 37 38 |
# File 'lib/mollie/order/line.rb', line 36 def cancelable? is_cancelable == true end |
#discounted? ⇒ Boolean
40 41 42 |
# File 'lib/mollie/order/line.rb', line 40 def discounted? !@discount_amount.nil? end |
#image_url ⇒ Object
56 57 58 |
# File 'lib/mollie/order/line.rb', line 56 def image_url Util.extract_url(links, 'image_url') end |
#product_url ⇒ Object
52 53 54 |
# File 'lib/mollie/order/line.rb', line 52 def product_url Util.extract_url(links, 'product_url') end |
#refundable? ⇒ Boolean
48 49 50 |
# File 'lib/mollie/order/line.rb', line 48 def refundable? refundable_quantity.to_i > 0 end |
#shippable? ⇒ Boolean
44 45 46 |
# File 'lib/mollie/order/line.rb', line 44 def shippable? shippable_quantity.to_i > 0 end |