Class: ParamsReady::Helpers::ConditionalBlock
- Inherits:
-
Conditional
- Object
- Conditional
- ParamsReady::Helpers::ConditionalBlock
- Defined in:
- lib/params_ready/helpers/conditional_block.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize(rule: nil, &block) ⇒ ConditionalBlock
constructor
A new instance of ConditionalBlock.
Methods inherited from Conditional
Constructor Details
#initialize(rule: nil, &block) ⇒ ConditionalBlock
Returns a new instance of ConditionalBlock.
24 25 26 27 28 |
# File 'lib/params_ready/helpers/conditional_block.rb', line 24 def initialize(rule: nil, &block) raise ParamsReadyError, "Block must not be empty" if block.nil? @block = block super(rule: rule) end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
22 23 24 |
# File 'lib/params_ready/helpers/conditional_block.rb', line 22 def block @block end |