Class: Macros4Cuke::Templating::Comment
- Inherits:
-
Object
- Object
- Macros4Cuke::Templating::Comment
- Defined in:
- lib/macros4cuke/templating/comment.rb
Overview
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.
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
The comment as extracted from the original template.
Instance Method Summary collapse
-
#initialize(aSourceText) ⇒ Comment
constructor
A new instance of Comment.
-
#render(_, _) ⇒ String
Render the comment.
Constructor Details
#initialize(aSourceText) ⇒ Comment
Returns a new instance of Comment.
19 20 21 |
# File 'lib/macros4cuke/templating/comment.rb', line 19 def initialize(aSourceText) @source = aSourceText end |
Instance Attribute Details
#source ⇒ Object (readonly)
The comment as extracted from the original template.
14 15 16 |
# File 'lib/macros4cuke/templating/comment.rb', line 14 def source @source end |
Instance Method Details
#render(_, _) ⇒ String
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.
30 31 32 |
# File 'lib/macros4cuke/templating/comment.rb', line 30 def render(_, _) return '' end |