Class: Veto::ConditionalBlock
- Defined in:
- lib/veto/blocks/conditional_block.rb
Direct Known Subclasses
ValidateBlock, ValidatesBlock, ValidatesBlock::CheckBlock, WithOptionsBlock
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(options = {}) ⇒ ConditionalBlock
constructor
A new instance of ConditionalBlock.
- #options(hash = {}) ⇒ Object
Methods inherited from Block
Constructor Details
#initialize(options = {}) ⇒ ConditionalBlock
Returns a new instance of ConditionalBlock.
3 4 5 6 |
# File 'lib/veto/blocks/conditional_block.rb', line 3 def initialize(={}) @options = super() end |
Instance Method Details
#call(*args) ⇒ Object
8 9 10 |
# File 'lib/veto/blocks/conditional_block.rb', line 8 def call(*args) call_children(*args) if conditions.pass?(*args) end |
#options(hash = {}) ⇒ Object
12 13 14 |
# File 'lib/veto/blocks/conditional_block.rb', line 12 def (hash={}) conditions_filter(:reject) end |