Class: Cucumber::HTMLFormatter::TemplateWriter
- Inherits:
-
Object
- Object
- Cucumber::HTMLFormatter::TemplateWriter
- Defined in:
- lib/cucumber/html_formatter/template_writer.rb
Instance Attribute Summary collapse
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template) ⇒ TemplateWriter
constructor
A new instance of TemplateWriter.
- #write_between(from, to) ⇒ Object
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
#template ⇒ Object (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 |