Sha256: be15cce6ed85cce9562cb2f8b3321f46a7ce94b760e48d2780d6bb7778bc9918

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

module Leap
  module Subject
    def self.extended(base)
      base.instance_variable_set :@decisions, {}
    end
    attr_reader :decisions
    def decide(goal, options = {}, &blk)
      decisions[goal] = ::Leap::Decision.new goal, options
      Blockenspiel.invoke(blk, decisions[goal])
      define_method goal do |considerations|
        self.class.decisions[goal].make send(self.class.decisions[goal].signature_method), considerations
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
leap-0.2.0 lib/leap/subject.rb