Sha256: 0276cf8c7ab2749feadfa48b906cec7368be081f5e0244e70516578a6e6b43de

Contents?: true

Size: 687 Bytes

Versions: 4

Compression:

Stored size: 687 Bytes

Contents

# sabshere 8/15/10 should this just be required in the emitter gem's lib/emitter.rb?
module BrighterPlanet
  module Residence
    module Summarization
      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
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
residence-0.0.18 lib/residence/summarization.rb
residence-0.0.17 lib/residence/summarization.rb
residence-0.0.16 lib/residence/summarization.rb
residence-0.0.15 lib/residence/summarization.rb