Class: Location::Address

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

Instance Method Summary collapse

Instance Method Details

#to_hashObject



18
19
20
21
22
23
24
25
26
27
28
# File 'app/models/location/address.rb', line 18

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