Class: Cucumber::HTMLFormatter::TemplateWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/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.



6
7
8
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/lib/cucumber/html_formatter/template_writer.rb', line 6

def initialize(template)
  @template = template
end

Instance Attribute Details

#templateObject (readonly)

Returns the value of attribute template.



4
5
6
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/lib/cucumber/html_formatter/template_writer.rb', line 4

def template
  @template
end

Instance Method Details

#write_between(from, to) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/lib/cucumber/html_formatter/template_writer.rb', line 10

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

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

  return before_to
end