Class: SecureTrading::Objects::Customer
- Inherits:
-
DataObject
- Object
- DataObject
- SecureTrading::Objects::Customer
- Defined in:
- lib/secure_trading/objects/customer.rb
Defined Under Namespace
Classes: Address
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#company ⇒ Object
Returns the value of attribute company.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Methods inherited from DataObject
Constructor Details
This class inherits a constructor from SecureTrading::DataObject
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def address @address end |
#company ⇒ Object
Returns the value of attribute company.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def company @company end |
#email_address ⇒ Object
Returns the value of attribute email_address.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def email_address @email_address end |
#first_name ⇒ Object
Returns the value of attribute first_name.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def last_name @last_name end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def phone_number @phone_number end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/secure_trading/objects/customer.rb', line 5 def title @title end |
Instance Method Details
#sanitize(value) ⇒ Object
23 24 25 |
# File 'lib/secure_trading/objects/customer.rb', line 23 def sanitize(value) Iconv.iconv('ascii//translit//IGNORE', 'utf-8//IGNORE', value).join end |
#to_hash ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/secure_trading/objects/customer.rb', line 7 def to_hash { 'Postal' => { 'Name' => { 'NamePrefix' => sanitize(self.title), 'FirstName' => sanitize(self.first_name), 'LastName' => sanitize(self.last_name) }, 'Company' => sanitize(self.company), 'Street' => sanitize(self.address.street), 'City' => sanitize(self.address.city), 'StateProv' => sanitize(self.address.state), 'PostalCode' => sanitize(self.address.postal_code), 'CountryCode' => sanitize(self.address.country) }, 'Telecom' => {'Phone' => sanitize(self.phone_number)}, 'Online' => {'Email' => sanitize(self.email_address)} } end |