class Veto::ValidatesBlock::CheckBlock

Public Class Methods

build(*args) click to toggle source
# 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.options)
  block
end
new(type, attribute_name, value_or_options=nil) click to toggle source
Calls superclass method Veto::ConditionalBlock::new
# File lib/veto/blocks/validates_block.rb, line 10
def initialize(type, attribute_name, value_or_options=nil)
  @type = type
  @attribute_name = attribute_name
  options =         
    case value_or_options
    when TrueClass
      {}
    when Hash
      value_or_options
    when Range, Array
      {:in => value_or_options}
    else
      {:with => value_or_options}
    end
  super(options)
end

Public Instance Methods

attribute_name() click to toggle source
# File lib/veto/blocks/validates_block.rb, line 27
def attribute_name
  @attribute_name
end
type() click to toggle source
# File lib/veto/blocks/validates_block.rb, line 31
def type
  @type
end