Class: Dina::Address
- Inherits:
-
Object
- Object
- Dina::Address
- Defined in:
- lib/dina/components/address.rb
Instance Attribute Summary collapse
-
#addressLine1 ⇒ Object
Returns the value of attribute addressLine1.
-
#addressLine2 ⇒ Object
Returns the value of attribute addressLine2.
-
#city ⇒ Object
Returns the value of attribute city.
-
#companyName ⇒ Object
Returns the value of attribute companyName.
-
#country ⇒ Object
Returns the value of attribute country.
-
#provinceState ⇒ Object
Returns the value of attribute provinceState.
-
#receiverName ⇒ Object
Returns the value of attribute receiverName.
-
#zipCode ⇒ Object
Returns the value of attribute zipCode.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Address
constructor
A new instance of Address.
- #to_hash ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Address
Returns a new instance of Address.
12 13 14 15 16 17 |
# File 'lib/dina/components/address.rb', line 12 def initialize(params = {}) params.each do |key, value| setter = "#{key}=" send(setter, value) if respond_to?(setter.to_sym, false) end end |
Instance Attribute Details
#addressLine1 ⇒ Object
Returns the value of attribute addressLine1.
5 6 7 |
# File 'lib/dina/components/address.rb', line 5 def addressLine1 @addressLine1 end |
#addressLine2 ⇒ Object
Returns the value of attribute addressLine2.
6 7 8 |
# File 'lib/dina/components/address.rb', line 6 def addressLine2 @addressLine2 end |
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/dina/components/address.rb', line 7 def city @city end |
#companyName ⇒ Object
Returns the value of attribute companyName.
4 5 6 |
# File 'lib/dina/components/address.rb', line 4 def companyName @companyName end |
#country ⇒ Object
Returns the value of attribute country.
10 11 12 |
# File 'lib/dina/components/address.rb', line 10 def country @country end |
#provinceState ⇒ Object
Returns the value of attribute provinceState.
8 9 10 |
# File 'lib/dina/components/address.rb', line 8 def provinceState @provinceState end |
#receiverName ⇒ Object
Returns the value of attribute receiverName.
3 4 5 |
# File 'lib/dina/components/address.rb', line 3 def receiverName @receiverName end |
#zipCode ⇒ Object
Returns the value of attribute zipCode.
9 10 11 |
# File 'lib/dina/components/address.rb', line 9 def zipCode @zipCode end |
Instance Method Details
#to_hash ⇒ Object
19 20 21 22 23 |
# File 'lib/dina/components/address.rb', line 19 def to_hash hash = {} instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) } hash.deep_symbolize_keys end |