Class: LabelMe::Order::Customer
- Inherits:
-
Object
- Object
- LabelMe::Order::Customer
- Defined in:
- lib/label_me/order/customer.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(row) ⇒ Customer
constructor
A new instance of Customer.
- #to_hash ⇒ Object
Constructor Details
#initialize(row) ⇒ Customer
Returns a new instance of Customer.
4 5 6 7 8 9 10 11 |
# File 'lib/label_me/order/customer.rb', line 4 def initialize(row) @number = row.customer_id.to_i @name = row.customer_name @email = row.customer_email @phone_number = row.customer_phone_number @address = row.customer_address @postal_code = row.customer_postal_code end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
17 18 19 |
# File 'lib/label_me/order/customer.rb', line 17 def address @address end |
#email ⇒ Object
Returns the value of attribute email.
15 16 17 |
# File 'lib/label_me/order/customer.rb', line 15 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/label_me/order/customer.rb', line 14 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
13 14 15 |
# File 'lib/label_me/order/customer.rb', line 13 def number @number end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
16 17 18 |
# File 'lib/label_me/order/customer.rb', line 16 def phone_number @phone_number end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
18 19 20 |
# File 'lib/label_me/order/customer.rb', line 18 def postal_code @postal_code end |
Instance Method Details
#===(other) ⇒ Object
31 32 33 |
# File 'lib/label_me/order/customer.rb', line 31 def ===(other) self.number == other.number end |
#to_hash ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/label_me/order/customer.rb', line 20 def to_hash { number: number, name: name, email: email, phone_number: phone_number, address: address, postal_code: postal_code } end |