Class: Rested::Validations

Inherits:
Object
  • Object
show all
Defined in:
lib/rested/validations.rb

Instance Method Summary collapse

Constructor Details

#initialize(validations_hash) ⇒ Validations



3
4
5
# File 'lib/rested/validations.rb', line 3

def initialize(validations_hash)
  self.validations_hash = validations_hash || {}
end

Instance Method Details

#countObject



13
14
15
# File 'lib/rested/validations.rb', line 13

def count
  validations_hash.size
end

#full_messagesObject



7
8
9
10
11
# File 'lib/rested/validations.rb', line 7

def full_messages
  validations_hash.inject([]) do |messages, validation|
    messages << "#{humanize(validation.first)} #{validation.last}"
  end
end