Module: Brcobranca::Validations::ClassMethods
- Defined in:
- lib/brcobranca/validations.rb
Instance Attribute Summary collapse
-
#eachs ⇒ Object
readonly
Returns the value of attribute eachs.
-
#inclusions ⇒ Object
readonly
Returns the value of attribute inclusions.
-
#lengths ⇒ Object
readonly
Returns the value of attribute lengths.
-
#numericals ⇒ Object
readonly
Returns the value of attribute numericals.
-
#presences ⇒ Object
readonly
Returns the value of attribute presences.
Instance Method Summary collapse
- #validates_each(*attr_names, &block) ⇒ Object
- #validates_inclusion_of(*attr_names) ⇒ Object
- #validates_length_of(*attr_names) ⇒ Object
- #validates_numericality_of(*attr_names) ⇒ Object
- #validates_presence_of(*attr_names) ⇒ Object
- #with_options(options, &block) ⇒ Object
Instance Attribute Details
#eachs ⇒ Object (readonly)
Returns the value of attribute eachs.
16 17 18 |
# File 'lib/brcobranca/validations.rb', line 16 def eachs @eachs end |
#inclusions ⇒ Object (readonly)
Returns the value of attribute inclusions.
16 17 18 |
# File 'lib/brcobranca/validations.rb', line 16 def inclusions @inclusions end |
#lengths ⇒ Object (readonly)
Returns the value of attribute lengths.
16 17 18 |
# File 'lib/brcobranca/validations.rb', line 16 def lengths @lengths end |
#numericals ⇒ Object (readonly)
Returns the value of attribute numericals.
16 17 18 |
# File 'lib/brcobranca/validations.rb', line 16 def numericals @numericals end |
#presences ⇒ Object (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 (, &block); end |