class Macros4Cuke::Templating::Comment

Class used internally by the template engine. Represents a comment from a template. A static text is a text that is reproduced verbatim when rendering a template.

Attributes

source[R]

The comment as extracted from the original template.

Public Class Methods

new(aSourceText) click to toggle source

@param aSourceText [String] A piece of text extracted

from the template that must be rendered verbatim.
# File lib/macros4cuke/templating/comment.rb, line 21
def initialize(aSourceText)
  @source = aSourceText
end

Public Instance Methods

render(_, _) click to toggle source

Render the comment. Comments are rendered as empty text. This is necessary because Cucumber::RbSupport::RbWorld#steps complains when it sees a comment. This method has the same signature as the {Engine#render} method. @return [String] Empty string (“as is”)

# File lib/macros4cuke/templating/comment.rb, line 30
def render(_, _)
  return ''
end