Method: Compony::Component.setup
- Defined in:
- lib/compony/component.rb
.setup(&block) ⇒ Object
DSL method
16 17 18 19 20 21 |
# File 'lib/compony/component.rb', line 16 def self.setup(&block) fail("`setup` expects a block in #{inspect}.") unless block_given? self.setup_blocks ||= [] self.setup_blocks = setup_blocks.dup # This is required to prevent the parent class to see children's setup blocks. setup_blocks << block end |