Exception: Pliny::Errors::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Pliny::Errors::Error
- Defined in:
- lib/pliny/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, id) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, id) ⇒ Error
Returns a new instance of Error.
12 13 14 15 |
# File 'lib/pliny/errors.rb', line 12 def initialize(, id) @id = id super() end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/pliny/errors.rb', line 4 def id @id end |
Class Method Details
.render(error) ⇒ Object
6 7 8 9 10 |
# File 'lib/pliny/errors.rb', line 6 def self.render(error) headers = { "Content-Type" => "application/json; charset=utf-8" } data = { id: error.id, message: error. } [error.status, headers, [MultiJson.encode(data)]] end |