Class: Unit

Inherits:
MLS::Model show all
Includes:
MLS::Avatar, MLS::Slugger
Defined in:
lib/mls/unit.rb

Instance Method Summary collapse

Methods included from MLS::Avatar

#avatar_url

Instance Method Details

#nameObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/mls/unit.rb', line 21

def name
  name = ""
  case self.type
  when 'unit'
    name += "Unit"
    name += " #{self.number}" if self.number
    name += " (Floor #{self.floor})" if self.floor
  when 'floor'
    name += "Floor"
    name += " #{self.floor}" if self.floor
    name += " (Unit #{self.number})" if self.number
  when 'building'
    "Entire Building"
  end
  name
end

#tagsObject



17
18
19
# File 'lib/mls/unit.rb', line 17

def tags
  read_attribute(:tags) || []
end