Class: Rested::Validations
- Inherits:
-
Object
- Object
- Rested::Validations
- Defined in:
- lib/rested/validations.rb
Instance Method Summary collapse
- #count ⇒ Object
- #full_messages ⇒ Object
-
#initialize(validations_hash) ⇒ Validations
constructor
A new instance of Validations.
Constructor Details
#initialize(validations_hash) ⇒ Validations
Returns a new instance of Validations.
3 4 5 |
# File 'lib/rested/validations.rb', line 3 def initialize(validations_hash) self.validations_hash = validations_hash || {} end |
Instance Method Details
#count ⇒ Object
13 14 15 |
# File 'lib/rested/validations.rb', line 13 def count validations_hash.size end |
#full_messages ⇒ Object
7 8 9 10 11 |
# File 'lib/rested/validations.rb', line 7 def validations_hash.inject([]) do |, validation| << "#{humanize(validation.first)} #{validation.last}" end end |