Class: Location::Address

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/location/address.rb

Direct Known Subclasses

NormalizableAddress

Instance Method Summary collapse

Instance Method Details

#to_hashObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/location/address.rb', line 13

def to_hash
  {
    postal_code: self.postal_code,
    street:      self.street,
    number:      self.number,
    complement:  self.complement,
    district:    self.district.try(:name),
    city:        self.city.try(:name),
    state:       self.state.try(:name)
  }
end