Class: Cucumber::HTMLFormatter::TemplateWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/html_formatter/template_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ TemplateWriter

Returns a new instance of TemplateWriter.



8
9
10
# File 'lib/cucumber/html_formatter/template_writer.rb', line 8

def initialize(template)
  @template = template
end

Instance Attribute Details

#templateObject (readonly)

Returns the value of attribute template.



6
7
8
# File 'lib/cucumber/html_formatter/template_writer.rb', line 6

def template
  @template
end

Instance Method Details

#write_between(from, to) ⇒ Object



12
13
14
15
16
17
# File 'lib/cucumber/html_formatter/template_writer.rb', line 12

def write_between(from, to)
  from_exists = !from.nil? && template.include?(from)

  after_from = from_exists ? template.split(from)[1] : template
  to.nil? ? after_from : after_from.split(to)[0]
end