Class: Lurker::ResponseCodePresenter

Inherits:
BasePresenter show all
Defined in:
lib/lurker/presenters/response_code_presenter.rb

Overview

An BasePresenter for ResponseCodes

Instance Attribute Summary collapse

Attributes inherited from BasePresenter

#options

Instance Method Summary collapse

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, options)
  super(options)
  @response_code = response_code
end

Instance Attribute Details

#response_codeObject (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

#descriptionObject



29
30
31
# File 'lib/lurker/presenters/response_code_presenter.rb', line 29

def description
  response_code["description"]
end

#statusObject



25
26
27
# File 'lib/lurker/presenters/response_code_presenter.rb', line 25

def status
  response_code["status"]
end

#successful?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/lurker/presenters/response_code_presenter.rb', line 21

def successful?
  response_code["successful"]
end

#to_htmlObject



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"