Class: Swaggable::Errors::ValidationsCollection
- Inherits:
-
Validation
- Object
- Swaggable::Errors::ValidationsCollection
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/swaggable/errors/validations_collection.rb
Instance Method Summary collapse
- #<<(entry) ⇒ Object
- #each(*args, &block) ⇒ Object
-
#initialize ⇒ ValidationsCollection
constructor
A new instance of ValidationsCollection.
- #inspect ⇒ Object
- #merge!(other) ⇒ Object
- #message ⇒ Object
Constructor Details
#initialize ⇒ ValidationsCollection
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 |
#inspect ⇒ Object
27 28 29 |
# File 'lib/swaggable/errors/validations_collection.rb', line 27 def inspect "#<#{self.class.name}: #{}>" 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 |
#message ⇒ Object
35 36 37 |
# File 'lib/swaggable/errors/validations_collection.rb', line 35 def list.map(&:message).join('. ') + '.' end |