Class: QaddyClient::Order
- Inherits:
-
Object
- Object
- QaddyClient::Order
- Includes:
- Helpers
- Defined in:
- lib/qaddy_client/order.rb
Instance Attribute Summary collapse
-
#customer_email ⇒ Object
readonly
Returns the value of attribute customer_email.
-
#customer_name ⇒ Object
readonly
Returns the value of attribute customer_name.
-
#discount_code_perc ⇒ Object
readonly
Returns the value of attribute discount_code_perc.
-
#internal_comment ⇒ Object
readonly
Returns the value of attribute internal_comment.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#order_items_attributes ⇒ Object
readonly
Returns the value of attribute order_items_attributes.
-
#send_email_after_hours ⇒ Object
readonly
Returns the value of attribute send_email_after_hours.
-
#send_email_at ⇒ Object
readonly
Returns the value of attribute send_email_at.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #add_item(order) ⇒ Object
-
#initialize(attributes) ⇒ Order
constructor
A new instance of Order.
Methods included from Helpers
#instance_variables_to_hash, #to_json
Constructor Details
#initialize(attributes) ⇒ Order
Returns a new instance of Order.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/qaddy_client/order.rb', line 16 def initialize(attributes) @customer_email = attributes[:customer_email] @customer_name = attributes[:customer_name] @discount_code_perc = attributes[:discount_code_perc] @number = attributes[:number] @send_email_after_hours = attributes[:send_email_after_hours] @send_email_at = attributes[:send_email_at] @total = attributes[:total] @internal_comment = attributes[:internal_comment] @order_items_attributes = Array.new end |
Instance Attribute Details
#customer_email ⇒ Object (readonly)
Returns the value of attribute customer_email.
5 6 7 |
# File 'lib/qaddy_client/order.rb', line 5 def customer_email @customer_email end |
#customer_name ⇒ Object (readonly)
Returns the value of attribute customer_name.
6 7 8 |
# File 'lib/qaddy_client/order.rb', line 6 def customer_name @customer_name end |
#discount_code_perc ⇒ Object (readonly)
Returns the value of attribute discount_code_perc.
7 8 9 |
# File 'lib/qaddy_client/order.rb', line 7 def discount_code_perc @discount_code_perc end |
#internal_comment ⇒ Object (readonly)
Returns the value of attribute internal_comment.
12 13 14 |
# File 'lib/qaddy_client/order.rb', line 12 def internal_comment @internal_comment end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
8 9 10 |
# File 'lib/qaddy_client/order.rb', line 8 def number @number end |
#order_items_attributes ⇒ Object (readonly)
Returns the value of attribute order_items_attributes.
14 15 16 |
# File 'lib/qaddy_client/order.rb', line 14 def order_items_attributes @order_items_attributes end |
#send_email_after_hours ⇒ Object (readonly)
Returns the value of attribute send_email_after_hours.
9 10 11 |
# File 'lib/qaddy_client/order.rb', line 9 def send_email_after_hours @send_email_after_hours end |
#send_email_at ⇒ Object (readonly)
Returns the value of attribute send_email_at.
10 11 12 |
# File 'lib/qaddy_client/order.rb', line 10 def send_email_at @send_email_at end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
11 12 13 |
# File 'lib/qaddy_client/order.rb', line 11 def total @total end |
Instance Method Details
#add_item(order) ⇒ Object
29 30 31 |
# File 'lib/qaddy_client/order.rb', line 29 def add_item(order) @order_items_attributes.push(order) end |