Module: Flexirest::Validation::ClassMethods

Defined in:
lib/flexirest/validation.rb

Instance Method Summary collapse

Instance Method Details

#_validationsObject



9
10
11
12
# File 'lib/flexirest/validation.rb', line 9

def _validations
  @_validations ||= []
  @_validations
end

#validates(field_name, options = {}, &block) ⇒ Object



4
5
6
7
# File 'lib/flexirest/validation.rb', line 4

def validates(field_name, options={}, &block)
  @_validations ||= []
  @_validations << {field_name:field_name, options:options, block:block}
end