Class: Mannequin::Address

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAddress

Returns a new instance of Address.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mannequin/address.rb', line 5

def initialize
  # Set variables from functions
  street_number = generated_street_number
  street_name = generated_street_name
  street_type = generated_street_type
  street_address = "#{street_number} #{street_name} #{street_type}"
  city = generated_city
  state = generated_state
  country = generated_country
  
  # Initialize attributes
  @street_address = street_address
  @street_number = street_number
  @street_name = street_name
  @street_type = street_type
  @city = city
  @state = state[1]
  @state_code = state[0]
  @country = country
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#state_codeObject (readonly)

Returns the value of attribute state_code.



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

def state_code
  @state_code
end

#street_addressObject (readonly)

Returns the value of attribute street_address.



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

def street_address
  @street_address
end

#street_nameObject (readonly)

Returns the value of attribute street_name.



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

def street_name
  @street_name
end

#street_numberObject (readonly)

Returns the value of attribute street_number.



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

def street_number
  @street_number
end

#street_typeObject (readonly)

Returns the value of attribute street_type.



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

def street_type
  @street_type
end