Class: Veto::ValidatesBlock::CheckBlock
- Inherits:
-
ConditionalBlock
- Object
- Block
- ConditionalBlock
- Veto::ValidatesBlock::CheckBlock
- Defined in:
- lib/veto/blocks/validates_block.rb
Class Method Summary collapse
Instance Method Summary collapse
- #attribute_name ⇒ Object
-
#initialize(type, attribute_name, value_or_options = nil) ⇒ CheckBlock
constructor
A new instance of CheckBlock.
- #type ⇒ Object
Methods inherited from ConditionalBlock
Methods inherited from Block
Constructor Details
#initialize(type, attribute_name, value_or_options = nil) ⇒ CheckBlock
Returns a new instance of CheckBlock.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/veto/blocks/validates_block.rb', line 10 def initialize(type, attribute_name, =nil) @type = type @attribute_name = attribute_name = case when TrueClass {} when Hash when Range, Array {:in => } else {:with => } end super() end |
Class Method Details
.build(*args) ⇒ Object
4 5 6 7 8 |
# File 'lib/veto/blocks/validates_block.rb', line 4 def self.build(*args) block = new(*args) block << ::Veto::CheckFactory.new(block.type, block.attribute_name, block.) block end |
Instance Method Details
#attribute_name ⇒ Object
27 28 29 |
# File 'lib/veto/blocks/validates_block.rb', line 27 def attribute_name @attribute_name end |
#type ⇒ Object
31 32 33 |
# File 'lib/veto/blocks/validates_block.rb', line 31 def type @type end |