Class: Dina::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/dina/components/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressLine1Object

Returns the value of attribute addressLine1.



5
6
7
# File 'lib/dina/components/address.rb', line 5

def addressLine1
  @addressLine1
end

#addressLine2Object

Returns the value of attribute addressLine2.



6
7
8
# File 'lib/dina/components/address.rb', line 6

def addressLine2
  @addressLine2
end

#cityObject

Returns the value of attribute city.



7
8
9
# File 'lib/dina/components/address.rb', line 7

def city
  @city
end

#companyNameObject

Returns the value of attribute companyName.



4
5
6
# File 'lib/dina/components/address.rb', line 4

def companyName
  @companyName
end

#countryObject

Returns the value of attribute country.



10
11
12
# File 'lib/dina/components/address.rb', line 10

def country
  @country
end

#provinceStateObject

Returns the value of attribute provinceState.



8
9
10
# File 'lib/dina/components/address.rb', line 8

def provinceState
  @provinceState
end

#receiverNameObject

Returns the value of attribute receiverName.



3
4
5
# File 'lib/dina/components/address.rb', line 3

def receiverName
  @receiverName
end

#zipCodeObject

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_hashObject



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