Sha256: 0b072761a50b6a09170af2edcf236287bcc6f7061ee29deb5d1129c10bab9f17

Contents?: true

Size: 1018 Bytes

Versions: 9

Compression:

Stored size: 1018 Bytes

Contents

module Pione
  module Lang
    # BasicModel is a class for pione model object.
    class BasicModel < Pione::PioneObject
      class << self
        # Return true if the object is atomic.
        #
        # @return [Boolean]
        #   true if the object is atom, or false.
        def atomic?
          @atomic ||= true
        end

        def set_atomic(b)
          @atomic = b
        end
      end

      forward :class, :atomic?

      # Creates a model object.
      def initialize(&b)
        instance_eval(&b) if block_given?
      end

      # Evaluates the model object in the variable table.
      def eval(env)
        return self
      end

      # Returns true if the object has pione variables.
      # @return [Boolean]
      #   true if the object has pione variables, or false
      def include_variable?
        false
      end

      # Returns rule definition document path.
      # @return [void]
      def set_document_path(path)
        @__document_path__ = path
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 lib/pione/lang/basic-model.rb
pione-0.5.0.alpha.2 lib/pione/lang/basic-model.rb
pione-0.5.0.alpha.1 lib/pione/lang/basic-model.rb
pione-0.4.2 lib/pione/lang/basic-model.rb
pione-0.4.1 lib/pione/lang/basic-model.rb
pione-0.4.0 lib/pione/lang/basic-model.rb
pione-0.3.2 lib/pione/lang/basic-model.rb
pione-0.3.1 lib/pione/lang/basic-model.rb
pione-0.3.0 lib/pione/lang/basic-model.rb