Class: Card::Format::HtmlFormat
- Inherits:
-
Card::Format
- Object
- Card::Format
- Card::Format::HtmlFormat
- Defined in:
- lib/card/format/html_format.rb
Overview
Main Format class for formatting card views in HTML
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options_need_save ⇒ Object
Returns the value of attribute options_need_save.
-
#skip_autosave ⇒ Object
Returns the value of attribute skip_autosave.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
- #escape_literal(literal) ⇒ Object
- #final_render_call(method) ⇒ Object
-
#focal? ⇒ Boolean
is the current card the requested card?.
- #main? ⇒ Boolean
- #mime_type ⇒ Object
- #stylesheet_link_tag(path) ⇒ Object
Instance Attribute Details
#options_need_save ⇒ Object
Returns the value of attribute options_need_save.
9 10 11 |
# File 'lib/card/format/html_format.rb', line 9 def @options_need_save end |
#skip_autosave ⇒ Object
Returns the value of attribute skip_autosave.
9 10 11 |
# File 'lib/card/format/html_format.rb', line 9 def skip_autosave @skip_autosave end |
#start_time ⇒ Object
Returns the value of attribute start_time.
9 10 11 |
# File 'lib/card/format/html_format.rb', line 9 def start_time @start_time end |
Instance Method Details
#escape_literal(literal) ⇒ Object
20 21 22 |
# File 'lib/card/format/html_format.rb', line 20 def escape_literal literal "<span>#{literal}</span>" end |
#final_render_call(method) ⇒ Object
28 29 30 31 |
# File 'lib/card/format/html_format.rb', line 28 def final_render_call method rendered = super rendered.is_a?(Array) ? output(rendered) : rendered end |
#focal? ⇒ Boolean
is the current card the requested card?
16 17 18 |
# File 'lib/card/format/html_format.rb', line 16 def focal? @focal ||= show_layout? ? main? : depth.zero? end |
#main? ⇒ Boolean
11 12 13 |
# File 'lib/card/format/html_format.rb', line 11 def main? !@main.nil? end |
#mime_type ⇒ Object
24 25 26 |
# File 'lib/card/format/html_format.rb', line 24 def mime_type "text/html" end |
#stylesheet_link_tag(path) ⇒ Object
33 34 35 |
# File 'lib/card/format/html_format.rb', line 33 def stylesheet_link_tag path tag "link", href: path, media: "all", rel: "stylesheet", type: "text/css" end |