Class: HubClustersCreator::Utils::Template::Render
- Inherits:
-
Object
- Object
- HubClustersCreator::Utils::Template::Render
- Defined in:
- lib/hub-clusters-creator/template.rb
Overview
Render is a class for templating
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
-
#get_binding ⇒ Object
rubocop:disable Naming/AccessorMethodName.
-
#initialize(context) ⇒ Render
constructor
A new instance of Render.
- #render(template) ⇒ Object
Constructor Details
#initialize(context) ⇒ Render
Returns a new instance of Render.
29 30 31 |
# File 'lib/hub-clusters-creator/template.rb', line 29 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
27 28 29 |
# File 'lib/hub-clusters-creator/template.rb', line 27 def context @context end |
Instance Method Details
#get_binding ⇒ Object
rubocop:disable Naming/AccessorMethodName
38 39 40 |
# File 'lib/hub-clusters-creator/template.rb', line 38 def get_binding binding end |
#render(template) ⇒ Object
33 34 35 |
# File 'lib/hub-clusters-creator/template.rb', line 33 def render(template) ERB.new(template, nil, '-').result(get_binding) end |