Class: Spoom::Coverage::Template
- Inherits:
-
Object
- Object
- Spoom::Coverage::Template
- Extended by:
- T::Helpers
- Defined in:
- lib/spoom/coverage/report.rb
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
17 18 19 |
# File 'lib/spoom/coverage/report.rb', line 17 def initialize(template:) @template = template end |
Instance Method Details
#erb ⇒ Object
: -> String
22 23 24 |
# File 'lib/spoom/coverage/report.rb', line 22 def erb File.read(@template) end |
#get_binding ⇒ Object
: -> Binding
32 33 34 |
# File 'lib/spoom/coverage/report.rb', line 32 def get_binding # rubocop:disable Naming/AccessorMethodName binding end |
#html ⇒ Object
: -> String
27 28 29 |
# File 'lib/spoom/coverage/report.rb', line 27 def html ERB.new(erb).result(get_binding) end |