Module: Bbrcobranca::Validations::ClassMethods
- Defined in:
- lib/bbrcobranca/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.
22 23 24 |
# File 'lib/bbrcobranca/validations.rb', line 22 def eachs @eachs end |
#inclusions ⇒ Object (readonly)
Returns the value of attribute inclusions.
21 22 23 |
# File 'lib/bbrcobranca/validations.rb', line 21 def inclusions @inclusions end |
#lengths ⇒ Object (readonly)
Returns the value of attribute lengths.
19 20 21 |
# File 'lib/bbrcobranca/validations.rb', line 19 def lengths @lengths end |
#numericals ⇒ Object (readonly)
Returns the value of attribute numericals.
20 21 22 |
# File 'lib/bbrcobranca/validations.rb', line 20 def numericals @numericals end |
#presences ⇒ Object (readonly)
Returns the value of attribute presences.
18 19 20 |
# File 'lib/bbrcobranca/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/bbrcobranca/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/bbrcobranca/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/bbrcobranca/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/bbrcobranca/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/bbrcobranca/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/bbrcobranca/validations.rb', line 51 def (, &block) end |