Class: Brainstorm::Selector
Instance Attribute Summary collapse
-
#function ⇒ Object
Returns the value of attribute function.
Instance Method Summary collapse
- #call(item) ⇒ Object
-
#initialize(*args, &block) ⇒ Selector
constructor
A new instance of Selector.
Methods inherited from Neuron
Constructor Details
#initialize(*args, &block) ⇒ Selector
Returns a new instance of Selector.
90 91 92 |
# File 'lib/brainstorm.rb', line 90 def initialize(*args, &block) @function = Brainstorm.function_for(*args, &block) end |
Instance Attribute Details
#function ⇒ Object
Returns the value of attribute function.
88 89 90 |
# File 'lib/brainstorm.rb', line 88 def function @function end |
Instance Method Details
#call(item) ⇒ Object
94 95 96 97 98 99 100 101 102 |
# File 'lib/brainstorm.rb', line 94 def call(item) if @function.call(item) fire start fire value(item) fire finish else fire value(item) end end |