Exception: Skylight::Api::CreateFailed Private
- Defined in:
- lib/skylight/api.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #res ⇒ Object readonly private
Instance Method Summary collapse
- #errors ⇒ Object private
-
#initialize(res) ⇒ CreateFailed
constructor
private
A new instance of CreateFailed.
- #to_s ⇒ Object private
Constructor Details
#initialize(res) ⇒ CreateFailed
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of CreateFailed.
11 12 13 14 |
# File 'lib/skylight/api.rb', line 11 def initialize(res) @res = res super "failed with status #{res.status}" end |
Instance Attribute Details
#res ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/skylight/api.rb', line 9 def res @res end |
Instance Method Details
#errors ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 |
# File 'lib/skylight/api.rb', line 16 def errors return unless res.respond_to?(:body) && res.body.is_a?(Hash) res.body['errors'] end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 26 27 28 29 |
# File 'lib/skylight/api.rb', line 21 def to_s if errors errors.inspect elsif res "#{res.class.to_s}: #{res.to_s}" else super end end |