Module: Call
- Defined in:
- lib/call.rb,
lib/call/trigger.rb,
lib/call/version.rb,
lib/call/response.rb
Defined Under Namespace
Classes: Response, Trigger
Constant Summary
collapse
- VERSION =
"0.0.2"
Class Method Summary
collapse
Class Method Details
.new(*responses) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/call.rb', line 6
def self.new(*responses)
Class.new(Trigger) do
responses.each do |response|
define_method response do |*args|
call response, *args
end
end
self.response_class = Class.new(Response) do
responses.each do |response|
define_method response do |&block|
trigger_responded(response, &block)
end
end
end
end
end
|