Class: FluQ::DSL::Feed
Overview
Feed-level DSL configuration
Instance Attribute Summary collapse
-
#handlers ⇒ Object
readonly
Returns the value of attribute handlers.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #handler(*type, &block) ⇒ Object
-
#initialize(name, &block) ⇒ Feed
constructor
A new instance of Feed.
- #input(*type, &block) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Feed
Returns a new instance of Feed.
5 6 7 8 9 10 |
# File 'lib/fluq/dsl/feed.rb', line 5 def initialize(name, &block) @name = name @inputs = [] @handlers = [] instance_eval(&block) end |
Instance Attribute Details
#handlers ⇒ Object (readonly)
Returns the value of attribute handlers.
3 4 5 |
# File 'lib/fluq/dsl/feed.rb', line 3 def handlers @handlers end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
3 4 5 |
# File 'lib/fluq/dsl/feed.rb', line 3 def inputs @inputs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/fluq/dsl/feed.rb', line 3 def name @name end |
Instance Method Details
#handler(*type, &block) ⇒ Object
19 20 21 22 |
# File 'lib/fluq/dsl/feed.rb', line 19 def handler(*type, &block) klass = constantize(:handler, *type) handlers.push [klass, FluQ::DSL::Options.new(&block).to_hash] end |
#input(*type, &block) ⇒ Object
13 14 15 16 |
# File 'lib/fluq/dsl/feed.rb', line 13 def input(*type, &block) klass = constantize(:input, *type) inputs.push [klass, FluQ::DSL::Options.new(&block).to_hash] end |