Class: Veto::ValidatesBlock
- Inherits:
-
ConditionalBlock
- Object
- Block
- ConditionalBlock
- Veto::ValidatesBlock
- Defined in:
- lib/veto/blocks/validates_block.rb
Defined Under Namespace
Classes: CheckBlock
Class Method Summary collapse
Instance Method Summary collapse
- #attribute_name ⇒ Object
-
#initialize(attribute_name, options = {}) ⇒ ValidatesBlock
constructor
A new instance of ValidatesBlock.
Methods inherited from ConditionalBlock
Methods inherited from Block
Constructor Details
#initialize(attribute_name, options = {}) ⇒ ValidatesBlock
Returns a new instance of ValidatesBlock.
42 43 44 45 |
# File 'lib/veto/blocks/validates_block.rb', line 42 def initialize(attribute_name, ={}) @attribute_name = attribute_name super() end |
Class Method Details
.build(*args) ⇒ Object
36 37 38 39 40 |
# File 'lib/veto/blocks/validates_block.rb', line 36 def self.build(*args) block = new(*args) block..each {|k,v| block << CheckBlock.build(k, block.attribute_name, v)} block end |
Instance Method Details
#attribute_name ⇒ Object
47 48 49 |
# File 'lib/veto/blocks/validates_block.rb', line 47 def attribute_name @attribute_name end |