Sha256: 8a3308931b95d0bbba6c812dc6fae642b3b627a3a4e64ebe09e73413cf47a410

Contents?: true

Size: 714 Bytes

Versions: 21

Compression:

Stored size: 714 Bytes

Contents

require 'summary_judgement'

module BrighterPlanet
  module Purchase
    module Summarization
      def self.included(base)
        base.extend SummaryJudgement
        base.summarize do |has|
          has.identity 'purchase'

          has.verb :take
          has.aspect :perfect

          has.modifier lambda { |purchase| "from #{purchase.merchant}" }, :if => :merchant
          has.modifier lambda { |purchase| "(#{purchase.inudstry} industry)" }, :if => :industry
          has.modifier lambda { |purchase| "for $#{purchase.purchase_amount}" }, :if => :purchase_amount
          has.modifier lambda { |purchase| "on #{date.to_formatted_s(:archive)}" }, :if => :date
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
purchase-1.0.15 lib/purchase/summarization.rb
purchase-1.0.14 lib/purchase/summarization.rb
purchase-1.0.13 lib/purchase/summarization.rb
purchase-1.0.12 lib/purchase/summarization.rb
purchase-1.0.11 lib/purchase/summarization.rb
purchase-1.0.10 lib/purchase/summarization.rb
purchase-1.0.9 lib/purchase/summarization.rb
purchase-1.0.8 lib/purchase/summarization.rb
purchase-1.0.7 lib/purchase/summarization.rb
purchase-1.0.6 lib/purchase/summarization.rb
purchase-1.0.5 lib/purchase/summarization.rb
purchase-1.0.4 lib/purchase/summarization.rb
purchase-1.0.3 lib/purchase/summarization.rb
purchase-1.0.2 lib/purchase/summarization.rb
purchase-1.0.1 lib/purchase/summarization.rb
purchase-1.0.0 lib/purchase/summarization.rb
purchase-0.1.8 lib/purchase/summarization.rb
purchase-0.1.7 lib/purchase/summarization.rb
purchase-0.1.6 lib/purchase/summarization.rb
purchase-0.1.5 lib/purchase/summarization.rb