Class: CukeModeler::Tag
- Includes:
- Named, Parsed, Parsing, Sourceable
- Defined in:
- lib/cuke_modeler/models/tag.rb
Overview
A class modeling a tag.
Instance Attribute Summary
Attributes included from Named
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.
-
#inspect(verbose: false) ⇒ String
See ‘Object#inspect`.
-
#to_s ⇒ String
Returns a string representation of this model.
Methods included from Parsing
Methods inherited from Model
Methods included from Containing
#each, #each_descendant, #each_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.
22 23 24 |
# File 'lib/cuke_modeler/models/tag.rb', line 22 def initialize(source_text = nil) super end |
Instance Method Details
#inspect(verbose: false) ⇒ String
See ‘Object#inspect`. Returns some basic information about the object, including its class, object ID, and its most meaningful attribute. For a Tag model, this will be the name of the tag. If verbose is true, provides default Ruby inspection behavior instead.
49 50 51 52 53 |
# File 'lib/cuke_modeler/models/tag.rb', line 49 def inspect(verbose: false) return super if verbose "#{super.chop} @name: #{@name.inspect}>" end |
#to_s ⇒ String
Returns a string representation of this model. For a Tag model, this will be Gherkin text that is equivalent to the tag being modeled.
33 34 35 |
# File 'lib/cuke_modeler/models/tag.rb', line 33 def to_s name || '' end |