Class: Spoom::Coverage::Template

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/spoom/coverage/report.rb

Direct Known Subclasses

Cards::Card, Page

Instance Method Summary collapse

Constructor Details

#initialize(template:) ⇒ Template

Returns a new instance of Template.



18
19
20
# File 'lib/spoom/coverage/report.rb', line 18

def initialize(template:)
  @template = template
end

Instance Method Details

#erbObject



23
24
25
# File 'lib/spoom/coverage/report.rb', line 23

def erb
  File.read(@template)
end

#get_bindingObject

rubocop:disable Naming/AccessorMethodName



33
34
35
# File 'lib/spoom/coverage/report.rb', line 33

def get_binding # rubocop:disable Naming/AccessorMethodName
  binding
end

#htmlObject



28
29
30
# File 'lib/spoom/coverage/report.rb', line 28

def html
  ERB.new(erb).result(get_binding)
end