Class: Rested::Validations

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

Instance Method Summary (collapse)

Constructor Details

- (Validations) initialize(validations_hash)



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

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

Instance Method Details

- (Object) count



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

def count
  validations_hash.size
end

- (Object) full_messages



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