Class: Fdoc::ResponseCodePresenter
Overview
An BasePresenter for ResponseCodes
Instance Attribute Summary collapse
#options
Instance Method Summary
collapse
#css_path, #get_binding, #html_directory, #index_path, #render_erb, #render_markdown, #tag_with_anchor
Constructor Details
5
6
7
8
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 5
def initialize(response_code, options)
super(options)
@response_code = response_code
end
|
Instance Attribute Details
#response_code ⇒ Object
Returns the value of attribute response_code.
3
4
5
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 3
def response_code
@response_code
end
|
Instance Method Details
#description ⇒ Object
33
34
35
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 33
def description
render_markdown(description_raw)
end
|
#description_raw ⇒ Object
37
38
39
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 37
def description_raw
response_code["description"]
end
|
#status ⇒ Object
29
30
31
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 29
def status
response_code["status"]
end
|
#successful? ⇒ Boolean
25
26
27
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 25
def successful?
response_code["successful"]
end
|
#to_html ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/fdoc/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"
|
#to_markdown ⇒ Object
21
22
23
|
# File 'lib/fdoc/presenters/response_code_presenter.rb', line 21
def to_markdown
"__#{status}__: #{description_raw}"
end
|