Sha256: 7014949f6a66342f40d4f567694fab7608f78ca42b9b455440531228f544a959

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 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.1 lib/leap/subject.rb