Class: Semlogr::Templates::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/semlogr/templates/template.rb

Constant Summary collapse

EMPTY =
Template.new([TextToken::EMPTY])

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens) ⇒ Template

Returns a new instance of Template.



8
9
10
# File 'lib/semlogr/templates/template.rb', line 8

def initialize(tokens)
  @tokens = tokens
end

Instance Attribute Details

#tokensObject

Returns the value of attribute tokens.



6
7
8
# File 'lib/semlogr/templates/template.rb', line 6

def tokens
  @tokens
end

Instance Method Details

#render(output, properties) ⇒ Object



12
13
14
15
16
# File 'lib/semlogr/templates/template.rb', line 12

def render(output, properties)
  @tokens.each do |token|
    token.render(output, properties)
  end
end