Exception: Pobo::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/pobo/errors.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, errors: {}) ⇒ ValidationError

Returns a new instance of ValidationError.



28
29
30
31
# File 'lib/pobo/errors.rb', line 28

def initialize(message, errors: {})
  @errors = errors
  super(message)
end

Instance Attribute Details

#errors ⇒ Object (readonly)

Returns the value of attribute errors.



26
27
28
# File 'lib/pobo/errors.rb', line 26

def errors
  @errors
end

Class Method Details

.empty_payload ⇒ Object



33
34
35
# File 'lib/pobo/errors.rb', line 33

def self.empty_payload
  new("Payload cannot be empty")
end

.too_many_items(count, max) ⇒ Object



37
38
39
# File 'lib/pobo/errors.rb', line 37

def self.too_many_items(count, max)
  new("Too many items: #{count} provided, maximum is #{max}")
end