Class: Veto::ValidatesBlock

Inherits:
ConditionalBlock show all
Defined in:
lib/veto/blocks/validates_block.rb

Defined Under Namespace

Classes: CheckBlock

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ConditionalBlock

#call, #options

Methods inherited from Block

#<<, #call, #children

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, options={})
  @attribute_name = attribute_name
  super(options)
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.options.each {|k,v| block << CheckBlock.build(k, block.attribute_name, v)}
  block
end

Instance Method Details

#attribute_nameObject



47
48
49
# File 'lib/veto/blocks/validates_block.rb', line 47

def attribute_name
  @attribute_name
end