Class: Alephant::Broker::Response::Base
- Inherits:
-
Object
- Object
- Alephant::Broker::Response::Base
- Defined in:
- lib/alephant/broker/response/base.rb
Direct Known Subclasses
Constant Summary collapse
- STATUS_CODE_MAPPING =
{ 200 => 'ok', 404 => 'Not found', 500 => 'Error retrieving content' }
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status = 200, content_type = "text/html") ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(status = 200, content_type = "text/html") ⇒ Base
Returns a new instance of Base.
15 16 17 18 19 20 21 |
# File 'lib/alephant/broker/response/base.rb', line 15 def initialize(status = 200, content_type = "text/html") @content_type = content_type @status = status @content = STATUS_CODE_MAPPING[status] setup end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/alephant/broker/response/base.rb', line 7 def content @content end |
#content_type ⇒ Object
Returns the value of attribute content_type.
7 8 9 |
# File 'lib/alephant/broker/response/base.rb', line 7 def content_type @content_type end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/alephant/broker/response/base.rb', line 7 def status @status end |