Class: CukeModeler::Tag
- Includes:
- Parsed, Parsing, Sourceable
- Defined in:
- lib/cuke_modeler/models/tag.rb
Overview
A class modeling a tag.
Instance Attribute Summary collapse
-
#name ⇒ Object
The name of the tag.
Attributes included from Sourceable
Attributes included from Parsed
Attributes included from Nested
Instance Method Summary collapse
-
#initialize(source_text = nil) ⇒ Tag
constructor
Creates a new Tag object and, if source_text is provided, populates the object.
-
#to_s ⇒ Object
Returns a string representation of this model.
Methods included from Parsing
Methods inherited from Model
Methods included from Nested
Constructor Details
#initialize(source_text = nil) ⇒ Tag
Creates a new Tag object and, if source_text is provided, populates the object.
18 19 20 21 22 23 24 25 |
# File 'lib/cuke_modeler/models/tag.rb', line 18 def initialize(source_text = nil) super(source_text) if source_text parsed_tag_data = parse_source(source_text) populate_tag(self, parsed_tag_data) end end |
Instance Attribute Details
#name ⇒ Object
The name of the tag
13 14 15 |
# File 'lib/cuke_modeler/models/tag.rb', line 13 def name @name end |
Instance Method Details
#to_s ⇒ Object
Returns a string representation of this model. For a tag model, this will be Gherkin text that is equivalent to the tag being modeled.
29 30 31 |
# File 'lib/cuke_modeler/models/tag.rb', line 29 def to_s name || '' end |