Class: Cadooz::Immutable::Address

Inherits:
Object
  • Object
show all
Includes:
Mixins
Defined in:
lib/cadooz/models/immutable/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixins

#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize

Constructor Details

#initialize(open_struct) ⇒ Address

Returns a new instance of Address.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cadooz/models/immutable/address.rb', line 8

def initialize(open_struct)
  @city = open_struct&.city
  @company =open_struct&.company
  @country = open_struct&.country
  @department = open_struct&.department
  @email = open_struct&.email
  @firstname = open_struct&.firstname
  @lastname = open_struct&.lastname
  @phone = open_struct&.phone
  @salutation = open_struct&.salutation
  @state = open_struct&.state
  @street = open_struct&.street
  @street_addon = open_struct&.street_addon
  @zip_code = open_struct&.zipcode

  self.freeze
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def city
  @city
end

#companyObject (readonly)

Returns the value of attribute company.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def company
  @company
end

#countryObject (readonly)

Returns the value of attribute country.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def country
  @country
end

#departmentObject (readonly)

Returns the value of attribute department.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def department
  @department
end

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def email
  @email
end

#firstnameObject (readonly)

Returns the value of attribute firstname.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def firstname
  @firstname
end

#lastnameObject (readonly)

Returns the value of attribute lastname.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def lastname
  @lastname
end

#phoneObject (readonly)

Returns the value of attribute phone.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def phone
  @phone
end

#salutationObject (readonly)

Returns the value of attribute salutation.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def salutation
  @salutation
end

#stateObject (readonly)

Returns the value of attribute state.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def state
  @state
end

#streetObject (readonly)

Returns the value of attribute street.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def street
  @street
end

#street_addonObject (readonly)

Returns the value of attribute street_addon.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def street_addon
  @street_addon
end

#zip_codeObject (readonly)

Returns the value of attribute zip_code.



4
5
6
# File 'lib/cadooz/models/immutable/address.rb', line 4

def zip_code
  @zip_code
end