Sha256: b7fd37aef2032a7023146067eb6434ab1a54b8daa809a6b4962c1f6fd7b5ceb1

Contents?: true

Size: 605 Bytes

Versions: 11

Compression:

Stored size: 605 Bytes

Contents

module EDN
  module Type
    class Symbol
      include EDN::CoreExt::AllowsMetadata

      attr_reader :symbol

      def initialize(sym)
        @symbol = sym.to_sym
      end

      def ==(other)
        return false unless other.is_a?(Symbol)
        to_sym == other.to_sym
      end

      def eql?(other)
        return false unless other.is_a?(Symbol)
        to_sym == other.to_sym
      end

      def hash
        @symbol.hash
      end

      def to_sym
        @symbol
      end

      def to_s
        @symbol.to_s
      end

      def to_edn
        @symbol.to_s
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
edn2023-1.1.4 lib/edn/type/symbol.rb
edn-1.1.1 lib/edn/type/symbol.rb
edn-1.1.0 lib/edn/type/symbol.rb
edn-1.0.8 lib/edn/type/symbol.rb
edn-1.0.7 lib/edn/type/symbol.rb
edn-1.0.6 lib/edn/type/symbol.rb
edn-1.0.5 lib/edn/type/symbol.rb
edn-1.0.3 lib/edn/type/symbol.rb
edn-1.0.2 lib/edn/type/symbol.rb
edn-1.0.1 lib/edn/type/symbol.rb
edn-1.0.0 lib/edn/type/symbol.rb