Module: Brcobranca::Validations::ClassMethods

Defined in:
lib/brcobranca/validations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eachsObject (readonly)

Returns the value of attribute eachs


22
23
24
# File 'lib/brcobranca/validations.rb', line 22

def eachs
  @eachs
end

#inclusionsObject (readonly)

Returns the value of attribute inclusions


21
22
23
# File 'lib/brcobranca/validations.rb', line 21

def inclusions
  @inclusions
end

#lengthsObject (readonly)

Returns the value of attribute lengths


19
20
21
# File 'lib/brcobranca/validations.rb', line 19

def lengths
  @lengths
end

#numericalsObject (readonly)

Returns the value of attribute numericals


20
21
22
# File 'lib/brcobranca/validations.rb', line 20

def numericals
  @numericals
end

#presencesObject (readonly)

Returns the value of attribute presences


18
19
20
# File 'lib/brcobranca/validations.rb', line 18

def presences
  @presences
end

Instance Method Details

#validates_each(*attr_names, &block) ⇒ Object


44
45
46
47
48
49
# File 'lib/brcobranca/validations.rb', line 44

def validates_each(*attr_names, &block)
  @eachs ||= {}
  attr_names.each do |attr_name|
    @eachs[attr_name] = block
  end
end

#validates_inclusion_of(*attr_names) ⇒ Object


39
40
41
42
# File 'lib/brcobranca/validations.rb', line 39

def validates_inclusion_of(*attr_names)
  @inclusions ||= []
  @inclusions = @inclusions << attr_names
end

#validates_length_of(*attr_names) ⇒ Object


29
30
31
32
# File 'lib/brcobranca/validations.rb', line 29

def validates_length_of(*attr_names)
  @lengths ||= []
  @lengths = @lengths << attr_names
end

#validates_numericality_of(*attr_names) ⇒ Object


34
35
36
37
# File 'lib/brcobranca/validations.rb', line 34

def validates_numericality_of(*attr_names)
  @numericals ||= []
  @numericals = @numericals << attr_names
end

#validates_presence_of(*attr_names) ⇒ Object


24
25
26
27
# File 'lib/brcobranca/validations.rb', line 24

def validates_presence_of(*attr_names)
  @presences ||= []
  @presences = @presences << attr_names
end

#with_options(options, &block) ⇒ Object


51
52
# File 'lib/brcobranca/validations.rb', line 51

def with_options(options, &block)
end