Class: Ordrin::Data::Address

Inherits:
OrdrinData show all
Defined in:
lib/ordrin/data.rb

Overview

Represents a street address

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OrdrinData

#make_dict

Constructor Details

#initialize(addr, city, state, zip, phone, addr2 = '') ⇒ Address

Store the parts of the address as fields in this object. Arguments: addr – Street address city – City state – State zip – Zip code phone – Phone number addr2 – Optional second street address line



29
30
31
32
33
34
35
36
# File 'lib/ordrin/data.rb', line 29

def initialize(addr, city, state, zip, phone, addr2='')
  @fields = [:addr, :city, :state, :zip, :phone, :addr2]
  @addr = addr
  @city = city
  @state = Normalize.normalize(state, :state)
  @zip = Normalize.normalize(zip, :zip)
  @phone = Normalize.normalize(phone, :phone)
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def addr
  @addr
end

#addr2Object (readonly)

Returns the value of attribute addr2.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def addr2
  @addr2
end

#cityObject (readonly)

Returns the value of attribute city.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def city
  @city
end

#fieldsObject (readonly)

Returns the value of attribute fields.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def fields
  @fields
end

#phoneObject (readonly)

Returns the value of attribute phone.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def phone
  @phone
end

#stateObject (readonly)

Returns the value of attribute state.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def state
  @state
end

#zipObject (readonly)

Returns the value of attribute zip.



19
20
21
# File 'lib/ordrin/data.rb', line 19

def zip
  @zip
end