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.
23 24 25 26 |
# File 'lib/skylight/api.rb', line 23 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.
21 22 23 |
# File 'lib/skylight/api.rb', line 21 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.
28 29 30 31 32 |
# File 'lib/skylight/api.rb', line 28 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.
34 35 36 37 38 39 40 41 42 |
# File 'lib/skylight/api.rb', line 34 def to_s if errors errors.inspect elsif res "#{res.class}: #{res}" else super end end |