Class: Hood

Inherits:
Object
  • Object
show all
Includes:
Geopolitocracy, Mongoid::Document
Defined in:
app/models/hood.rb

Overview

Hood/Neighborhood

Instance Method Summary collapse

Methods included from Geopolitocracy

#ensure_slug, #slug=, #to_s

Instance Method Details

#as_json(_opts = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'app/models/hood.rb', line 23

def as_json(_opts = {})
  {
    id: id.to_s,
    name: name,
    city: city
  }
end

#phoneObject



15
16
17
# File 'app/models/hood.rb', line 15

def phone
  self[:phone] || city.phone
end

#postalObject



19
20
21
# File 'app/models/hood.rb', line 19

def postal
  self[:postal] || city.postal
end