Sha256: adde8e299a898e10ec2dcb149cfda41c5e86dd0b612c14d0e6c674e1b31db29d

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 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

1 entries across 1 versions & 1 rubygems

Version Path
cuke_modeler-3.6.0 lib/cuke_modeler/models/model.rb