Class: HubClustersCreator::Utils::Template::Render

Inherits:
Object
  • Object
show all
Defined in:
lib/hub-clusters-creator/template.rb

Overview

Render is a class for templating

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextObject

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_bindingObject

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