Class: Unit::Types::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/types/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(street, city, state, postal_code, country, street2 = nil) ⇒ Address

Returns a new instance of Address.

Parameters:

  • street (String)
  • city (String)
  • state (String)
  • postal_code (String)
  • country (String)
  • optional

    street2 [String]



14
15
16
17
18
19
20
21
# File 'lib/unit/types/address.rb', line 14

def initialize(street, city, state, postal_code, country, street2 = nil)
  @street = street
  @street2 = street2
  @city = city
  @state = state
  @postal_code = postal_code
  @country = country
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def country
  @country
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def postal_code
  @postal_code
end

#stateObject (readonly)

Returns the value of attribute state.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def state
  @state
end

#streetObject (readonly)

Returns the value of attribute street.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def street
  @street
end

#street2Object (readonly)

Returns the value of attribute street2.



6
7
8
# File 'lib/unit/types/address.rb', line 6

def street2
  @street2
end

Instance Method Details

#representObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/unit/types/address.rb', line 23

def represent
  {
    street: street,
    street2: street2,
    city: city,
    state: state,
    postalCode: postal_code,
    country: country
  }
end