Class: JsonApiErrors::Error
- Inherits:
-
Object
- Object
- JsonApiErrors::Error
- Extended by:
- Forwardable
- Defined in:
- lib/json_api_errors/error.rb
Instance Attribute Summary collapse
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(template: JsonApiErrors::Templates::Default.new) ⇒ Error
constructor
A new instance of Error.
- #status_code ⇒ Object
Constructor Details
#initialize(template: JsonApiErrors::Templates::Default.new) ⇒ Error
Returns a new instance of Error.
31 32 33 |
# File 'lib/json_api_errors/error.rb', line 31 def initialize(template: JsonApiErrors::Templates::Default.new) @template = template end |
Instance Attribute Details
#template ⇒ Object
Returns the value of attribute template.
29 30 31 |
# File 'lib/json_api_errors/error.rb', line 29 def template @template end |
Instance Method Details
#call ⇒ Object
35 36 37 |
# File 'lib/json_api_errors/error.rb', line 35 def call template.render end |
#status_code ⇒ Object
39 40 41 |
# File 'lib/json_api_errors/error.rb', line 39 def status_code template.status end |