Class: QaddyClient::Order

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/qaddy_client/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_emailObject (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_nameObject (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_percObject (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_commentObject (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

#numberObject (readonly)

Returns the value of attribute number.



8
9
10
# File 'lib/qaddy_client/order.rb', line 8

def number
  @number
end

#order_items_attributesObject (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_hoursObject (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_atObject (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

#totalObject (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