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.



16
17
18
# File 'lib/brcobranca/validations.rb', line 16

def eachs
  @eachs
end

#inclusionsObject (readonly)

Returns the value of attribute inclusions.



16
17
18
# File 'lib/brcobranca/validations.rb', line 16

def inclusions
  @inclusions
end

#lengthsObject (readonly)

Returns the value of attribute lengths.



16
17
18
# File 'lib/brcobranca/validations.rb', line 16

def lengths
  @lengths
end

#numericalsObject (readonly)

Returns the value of attribute numericals.



16
17
18
# File 'lib/brcobranca/validations.rb', line 16

def numericals
  @numericals
end

#presencesObject (readonly)

Returns the value of attribute presences.



16
17
18
# File 'lib/brcobranca/validations.rb', line 16

def presences
  @presences
end

Instance Method Details

#validates_each(*attr_names, &block) ⇒ Object



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

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



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

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

#validates_length_of(*attr_names) ⇒ Object



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

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

#validates_numericality_of(*attr_names) ⇒ Object



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

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

#validates_presence_of(*attr_names) ⇒ Object



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

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

#with_options(options, &block) ⇒ Object



45
# File 'lib/brcobranca/validations.rb', line 45

def with_options(options, &block); end