Module: BrighterPlanet::Residence::Summarization

Defined in:
lib/residence/summarization.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/residence/summarization.rb', line 5

def self.included(base)
  base.summarize do |has|
    has.adjective lambda { |residence| "#{residence.rooms}-room" }, :if => :rooms
    has.identity [:residence_class, :name], :if => :residence_class
    has.identity
    has.modifier lambda { |residence| "in #{residence.zip_code.description_with_state_name}"}, :if => :zip_code
    has.modifier lambda { |residence| "with #{residence.residents} residents"}, :if => :residents
    has.verb :occupy
  end
end