Class: WrapperBased::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/wrapper_based/context.rb

Constant Summary collapse

UnassignedRole =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initialize(**where) ⇒ Context

Returns a new instance of Context.



3
4
5
6
# File 'lib/wrapper_based/context.rb', line 3

def initialize(**where)
  @_casting = {}
  where.each { |role, player| send :"#{role}=", player }
end

Instance Method Details

#[](*args, &block) ⇒ Object



12
13
14
# File 'lib/wrapper_based/context.rb', line 12

def [](*args, &block)
  call(*args, &block)
end

#to_procObject



8
9
10
# File 'lib/wrapper_based/context.rb', line 8

def to_proc
  method(:call).to_proc
end