Class: Factor::Connector::ListenerBuilder
- Inherits:
-
Object
- Object
- Factor::Connector::ListenerBuilder
- Defined in:
- lib/builders/listener_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(id, &block) ⇒ ListenerBuilder
constructor
A new instance of ListenerBuilder.
- #start(&code) ⇒ Object
- #stop(&code) ⇒ Object
Constructor Details
#initialize(id, &block) ⇒ ListenerBuilder
Returns a new instance of ListenerBuilder.
7 8 9 10 |
# File 'lib/builders/listener_builder.rb', line 7 def initialize(id, &block) @id = id.to_s instance_eval(&block) if block end |
Instance Method Details
#build ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/builders/listener_builder.rb', line 20 def build ld = ListenerDefinition.new ld.id = @id ld.start = @start ld.stop = @stop ld end |
#start(&code) ⇒ Object
12 13 14 |
# File 'lib/builders/listener_builder.rb', line 12 def start(&code) @start = code end |
#stop(&code) ⇒ Object
16 17 18 |
# File 'lib/builders/listener_builder.rb', line 16 def stop(&code) @stop = code end |