Class: Spoom::Coverage::Template Abstract
- Inherits:
-
Object
- Object
- Spoom::Coverage::Template
- Defined in:
- lib/spoom/coverage/report.rb
Overview
This class is abstract.
Direct Known Subclasses
Instance Method Summary collapse
-
#erb ⇒ Object
: -> String.
-
#get_binding ⇒ Object
: -> Binding.
-
#html ⇒ Object
: -> String.
-
#initialize(template:) ⇒ Template
constructor
Create a new template from an Erb file path : (template: String) -> void.
Constructor Details
#initialize(template:) ⇒ Template
Create a new template from an Erb file path : (template: String) -> void
14 15 16 |
# File 'lib/spoom/coverage/report.rb', line 14 def initialize(template:) @template = template end |
Instance Method Details
#erb ⇒ Object
: -> String
19 20 21 |
# File 'lib/spoom/coverage/report.rb', line 19 def erb File.read(@template) end |
#get_binding ⇒ Object
: -> Binding
29 30 31 |
# File 'lib/spoom/coverage/report.rb', line 29 def get_binding # rubocop:disable Naming/AccessorMethodName binding end |
#html ⇒ Object
: -> String
24 25 26 |
# File 'lib/spoom/coverage/report.rb', line 24 def html ERB.new(erb).result(get_binding) end |