Class: WrapperBased::Context
- Inherits:
-
Object
- Object
- WrapperBased::Context
- Defined in:
- lib/wrapper_based/context.rb
Constant Summary collapse
- UnassignedRole =
Class.new(StandardError)
Instance Method Summary collapse
- #[](*args, &block) ⇒ Object
-
#initialize(**where) ⇒ Context
constructor
A new instance of Context.
- #to_proc ⇒ Object
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_proc ⇒ Object
8 9 10 |
# File 'lib/wrapper_based/context.rb', line 8 def to_proc method(:call).to_proc end |