Class: Swaggable::Errors::ValidationsCollection

Inherits:
Validation
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/swaggable/errors/validations_collection.rb

Instance Method Summary collapse

Constructor Details

#initializeValidationsCollection

Returns a new instance of ValidationsCollection.



15
16
17
# File 'lib/swaggable/errors/validations_collection.rb', line 15

def initialize
  @list = []
end

Instance Method Details

#<<(entry) ⇒ Object



19
20
21
# File 'lib/swaggable/errors/validations_collection.rb', line 19

def << entry
  list << entry
end

#each(*args, &block) ⇒ Object



23
24
25
# File 'lib/swaggable/errors/validations_collection.rb', line 23

def each *args, &block
  list.each(*args, &block)
end

#inspectObject



27
28
29
# File 'lib/swaggable/errors/validations_collection.rb', line 27

def inspect
  "#<#{self.class.name}: #{message}>"
end

#merge!(other) ⇒ Object



31
32
33
# File 'lib/swaggable/errors/validations_collection.rb', line 31

def merge! other
  other.each {|e| self << e }
end

#messageObject



35
36
37
# File 'lib/swaggable/errors/validations_collection.rb', line 35

def message
  list.map(&:message).join('. ') + '.'
end