Exception: Acfs::InvalidResource
- Inherits:
-
ErroneousResponse
- Object
- StandardError
- Error
- ErroneousResponse
- Acfs::InvalidResource
- Defined in:
- lib/acfs/errors.rb
Overview
422
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Attributes inherited from ErroneousResponse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ InvalidResource
constructor
A new instance of InvalidResource.
Constructor Details
#initialize(opts = {}) ⇒ InvalidResource
Returns a new instance of InvalidResource.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/acfs/errors.rb', line 86 def initialize(opts = {}) @errors = opts.delete :errors @resource = opts.delete :resource case @errors when Hash opts[:message] ||= @errors.each_pair.map do |k, v| @errors.is_a?(Array) ? "#{k}: #{v.join(', ')}" : "#{k}: #{v}" end.join ', ' when Array opts[:message] ||= @errors.join ', ' end super end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
84 85 86 |
# File 'lib/acfs/errors.rb', line 84 def errors @errors end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
84 85 86 |
# File 'lib/acfs/errors.rb', line 84 def resource @resource end |