Class: FlakyTestTracker::Rendering

Inherits:
Object
  • Object
show all
Defined in:
lib/flaky_test_tracker/rendering.rb

Overview

ERB template rendering.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template:) ⇒ Rendering

Returns a new instance of Rendering.



10
11
12
# File 'lib/flaky_test_tracker/rendering.rb', line 10

def initialize(template:)
  @template = template
end

Instance Attribute Details

#templateObject (readonly)

Returns the value of attribute template.



8
9
10
# File 'lib/flaky_test_tracker/rendering.rb', line 8

def template
  @template
end

Instance Method Details

#output(**locals) ⇒ Object

Create a ERB template from #template and return the result bind with the locales.

Parameters:

  • locals

    The locales that will be bind to the ERB template.

Returns:

  • String



17
18
19
# File 'lib/flaky_test_tracker/rendering.rb', line 17

def output(**locals)
  ERB.new(template).result_with_hash(locals)
end