Module: SwingSupport::Extensions::Blocks
- Defined in:
- lib/swing_support/extensions/blocks.rb
Overview
Module allows including classes to process blocks given to constructor If the class defines #add_block_listener method, block is treated as default listener, otherwise, newly constructed object is just yielded to the block
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.included(host) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/swing_support/extensions/blocks.rb', line 7 def self.included host host.send :extend, ClassMethods host.instance_eval do alias :new_without_blocks :new alias :new :new_with_blocks end end |