Class: Alephant::Broker::ErrorComponent
- Inherits:
-
Object
- Object
- Alephant::Broker::ErrorComponent
- Defined in:
- lib/alephant/broker/error_component.rb
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #content_type ⇒ Object
- #headers ⇒ Object
-
#initialize(meta, status, exception) ⇒ ErrorComponent
constructor
A new instance of ErrorComponent.
Constructor Details
#initialize(meta, status, exception) ⇒ ErrorComponent
Returns a new instance of ErrorComponent.
6 7 8 9 10 11 12 |
# File 'lib/alephant/broker/error_component.rb', line 6 def initialize(, status, exception) @batch_id = .batch_id @status = status @content = content_for exception @id = .id @options = {} end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
4 5 6 |
# File 'lib/alephant/broker/error_component.rb', line 4 def batch_id @batch_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
4 5 6 |
# File 'lib/alephant/broker/error_component.rb', line 4 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/alephant/broker/error_component.rb', line 4 def id @id end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/alephant/broker/error_component.rb', line 4 def @options end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/alephant/broker/error_component.rb', line 4 def status @status end |
Instance Method Details
#content_type ⇒ Object
14 15 16 |
# File 'lib/alephant/broker/error_component.rb', line 14 def content_type headers["Content-Type"] end |
#headers ⇒ Object
18 19 20 21 22 |
# File 'lib/alephant/broker/error_component.rb', line 18 def headers { "Content-Type" => "text/plain" } end |