Sha256: 35921431366cb938bc5c05125f8f7475d9f025665e1463e4753bdf02b5906e02

Contents?: true

Size: 627 Bytes

Versions: 2

Compression:

Stored size: 627 Bytes

Contents

module MiniKraken
  module Core
    class AnyValue
      attr_reader :rank
      
      # @param aName [String]
      # @param anEnv [Vocabulary]
      def initialize(aName, anEnv, alternate_names = [])
        @rank = anEnv.get_rank(aName, alternate_names)
      end
      
      def ==(other)
        rank == other.rank
      end
      
      # Use same text representation as in Reasoned Schemer.
      def to_s
        "_#{rank}"
      end
      
      def ground?(_env)
        false
      end
      
      # @return [AnyValue]
      def quote(_env)
        self
      end      
    end # class
  end # module
end # module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mini_kraken-0.1.04 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.03 lib/mini_kraken/core/any_value.rb