Class: CukeModeler::Model
- Inherits:
-
Object
- Object
- CukeModeler::Model
- Includes:
- Containing, Nested
- Defined in:
- lib/cuke_modeler/models/model.rb
Overview
A class modeling an element of a Cucumber suite.
Direct Known Subclasses
Background, Cell, Comment, Directory, DocString, Example, Feature, FeatureFile, Outline, Row, Rule, Scenario, Step, Table, Tag
Instance Attribute Summary
Attributes included from Nested
Instance Method Summary collapse
-
#children ⇒ Object
Returns the model objects that belong to this model.
-
#initialize(source_text = nil) ⇒ Model
constructor
Creates a new Model object and, if source_text is provided, populates the object.
-
#to_s ⇒ Object
Returns a string representation of this model.
Methods included from Containing
Methods included from Nested
Constructor Details
#initialize(source_text = nil) ⇒ Model
Creates a new Model object and, if source_text is provided, populates the object.
13 14 15 16 17 |
# File 'lib/cuke_modeler/models/model.rb', line 13 def initialize(source_text = nil) raise(ArgumentError, "Can only create models from Strings but was given a #{source_text.class}.") if source_text && !source_text.is_a?(String) # This should be overridden by a child class end |
Instance Method Details
#children ⇒ Object
Returns the model objects that belong to this model.
26 27 28 29 |
# File 'lib/cuke_modeler/models/model.rb', line 26 def children # This should be overridden by a child class [] end |
#to_s ⇒ Object
Returns a string representation of this model.
20 21 22 23 |
# File 'lib/cuke_modeler/models/model.rb', line 20 def to_s # This should be overridden by a child class super end |