Class: Lurker::ResponseCodePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Lurker::ResponseCodePresenter
- Defined in:
- lib/lurker/presenters/response_code_presenter.rb
Overview
An BasePresenter for ResponseCodes
Instance Attribute Summary collapse
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(response_code, options) ⇒ ResponseCodePresenter
constructor
A new instance of ResponseCodePresenter.
- #status ⇒ Object
- #successful? ⇒ Boolean
- #to_html ⇒ Object
Methods inherited from BasePresenter
#asset_path, #assets, #html_directory, #index_path, #markup, #tag_with_anchor, #url_base_path
Constructor Details
#initialize(response_code, options) ⇒ ResponseCodePresenter
Returns a new instance of ResponseCodePresenter.
5 6 7 8 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 5 def initialize(response_code, ) super() @response_code = response_code end |
Instance Attribute Details
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
3 4 5 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 3 def response_code @response_code end |
Instance Method Details
#description ⇒ Object
29 30 31 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 29 def description response_code["description"] end |
#status ⇒ Object
25 26 27 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 25 def status response_code["status"] end |
#successful? ⇒ Boolean
21 22 23 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 21 def successful? response_code["successful"] end |
#to_html ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lurker/presenters/response_code_presenter.rb', line 10 def to_html " <div class=\"response-code\">\n <span class=\"status\">\n \#{status}\n </span>\n \#{description}\n </div>\n EOS\nend\n" |