Sha256: 371bd002ff27ef0796854cf8733217943190ba848af7ba74cebede4df411b2b8

Contents?: true

Size: 785 Bytes

Versions: 12

Compression:

Stored size: 785 Bytes

Contents

module CukeModeler

  # A class modeling an element of a Cucumber suite.
  class Model

    include Nested
    include Containing


    # Creates a new Model object and, if *source_text* is provided,
    # populates the object.
    def initialize(source_text = nil)
      error_message = "Can only create models from Strings but was given a #{source_text.class}."
      raise(ArgumentError, error_message) if source_text && !source_text.is_a?(String)

      # This should be overridden by a child class
    end

    # Returns a string representation of this model.
    def to_s
      # This should be overridden by a child class
      super
    end

    # Returns the model objects that belong to this model.
    def children
      []
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cuke_modeler-3.18.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.17.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.16.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.15.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.14.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.13.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.12.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.11.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.10.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.9.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.8.0 lib/cuke_modeler/models/model.rb
cuke_modeler-3.7.0 lib/cuke_modeler/models/model.rb