Sha256: a752df975e9613b83ca903a565b1d97a23d242651727d3a46178f84a4c340a98

Contents?: true

Size: 623 Bytes

Versions: 9

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

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

9 entries across 9 versions & 1 rubygems

Version Path
mini_kraken-0.1.13 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.12 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.11 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.10 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.09 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.08 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.07 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.06 lib/mini_kraken/core/any_value.rb
mini_kraken-0.1.05 lib/mini_kraken/core/any_value.rb