Class: QuickScript::Interaction::ScopeResponder

Inherits:
Object
  • Object
show all
Defined in:
lib/quick_script/interaction.rb

Instance Method Summary collapse

Constructor Details

#initializeScopeResponder

Returns a new instance of ScopeResponder.



12
13
14
# File 'lib/quick_script/interaction.rb', line 12

def initialize
	@names = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *args, &block) ⇒ Object



18
19
20
# File 'lib/quick_script/interaction.rb', line 18

def method_missing(method_sym, *args, &block)
	@names[method_sym] = block
end

Instance Method Details

#respond(scope) ⇒ Object



15
16
17
# File 'lib/quick_script/interaction.rb', line 15

def respond(scope)
	@names[scope[:name]].call
end