Class: Andromeda::Kit::Block
- Inherits:
-
Plan
- Object
- Impl::ConnectorBase
- Impl::ProtoPlan
- Plan
- Andromeda::Kit::Block
- Includes:
- Transf
- Defined in:
- lib/andromeda/kit.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Attributes included from Transf
Attributes inherited from Plan
#error_level, #log, #marker, #nick, #trace_enter, #trace_exit
Attributes inherited from Impl::ProtoPlan
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Block
constructor
A new instance of Block.
- #on_enter(key, val) ⇒ Object
Methods included from Transf
Methods inherited from Plan
#initialize_copy, #pool, #tap, #to_short_s
Methods inherited from Impl::ProtoPlan
#>>, #current_name, #current_scope, #data_key, #data_tag, #data_val, #dest, #entry, #init_guide, #initialize_copy, #key_label, #key_spot, #map_data, #mute, name_spot, #post_data, #post_to, #public_spot, #selects?, #signal_name?, signal_names, #signal_names, signal_spot, spot_attr, #spot_attr_name?, spot_attr_names, #spot_attr_names, spot_meth, #spot_meth_name?, #spot_meth_names, spot_meth_names, #spot_name?, spot_names, #spot_names, #tags, #to_short_s, #via
Methods included from Impl::To_S
Methods inherited from Impl::ConnectorBase
Constructor Details
#initialize(config = {}) ⇒ Block
Returns a new instance of Block.
27 28 29 30 31 |
# File 'lib/andromeda/kit.rb', line 27 def initialize(config = {}) super config raise ArgumentError unless block_given? @block = lambda { |key, val| yield key, val } end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
23 24 25 |
# File 'lib/andromeda/kit.rb', line 23 def block @block end |
Instance Method Details
#on_enter(key, val) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/andromeda/kit.rb', line 33 def on_enter(key, val) if @block super key, (instance_exec key, val, &@block) else super key, val end end |