Class: Spoom::Coverage::Page
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/spoom/coverage/report.rb
Direct Known Subclasses
Constant Summary collapse
- TEMPLATE =
T.let("#{Spoom::SPOOM_PATH}/templates/page.erb", String)
Instance Attribute Summary collapse
-
#palette ⇒ Object
readonly
: D3::ColorPalette.
-
#title ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#body_html ⇒ Object
: -> String.
- #cards ⇒ Object
-
#footer_html ⇒ Object
: -> String.
-
#header_html ⇒ Object
: -> String.
-
#header_script ⇒ Object
: -> String.
-
#header_style ⇒ Object
: -> String.
-
#initialize(title:, palette:, template: TEMPLATE) ⇒ Page
constructor
: (title: String, palette: D3::ColorPalette, ?template: String) -> void.
Methods inherited from Template
Constructor Details
#initialize(title:, palette:, template: TEMPLATE) ⇒ Page
: (title: String, palette: D3::ColorPalette, ?template: String) -> void
52 53 54 55 56 |
# File 'lib/spoom/coverage/report.rb', line 52 def initialize(title:, palette:, template: TEMPLATE) super(template: template) @title = title @palette = palette end |
Instance Attribute Details
#palette ⇒ Object (readonly)
: D3::ColorPalette
49 50 51 |
# File 'lib/spoom/coverage/report.rb', line 49 def palette @palette end |
#title ⇒ Object (readonly)
: String
46 47 48 |
# File 'lib/spoom/coverage/report.rb', line 46 def title @title end |
Instance Method Details
#body_html ⇒ Object
: -> String
74 75 76 |
# File 'lib/spoom/coverage/report.rb', line 74 def body_html cards.map(&:html).join("\n") end |
#cards ⇒ Object
79 |
# File 'lib/spoom/coverage/report.rb', line 79 def cards; end |
#footer_html ⇒ Object
: -> String
82 83 84 |
# File 'lib/spoom/coverage/report.rb', line 82 def "Generated by <a href='https://github.com/Shopify/spoom'>spoom</a> on #{Time.now.utc}." end |
#header_html ⇒ Object
: -> String
69 70 71 |
# File 'lib/spoom/coverage/report.rb', line 69 def header_html "<h1 class='display-3'>#{title}</h1>" end |
#header_script ⇒ Object
: -> String
64 65 66 |
# File 'lib/spoom/coverage/report.rb', line 64 def header_script D3.header_script(palette) end |
#header_style ⇒ Object
: -> String
59 60 61 |
# File 'lib/spoom/coverage/report.rb', line 59 def header_style D3.header_style end |