Sha256: 33ac94155c2c1c4377a8e20633525183cfe77750f66424876904265786a3c349

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true



module Antlr4ruby
  class DoubleKeyMap

    private
    attr_accessor :data

    public
    def put(key1, key2, value)
      data[key1] = {} unless data.has_key?(key1)
      sub_data = data[key1]
      prev = sub_data[key2]
      sub_data[key2] = value
      prev
    end

    def get(key1, key2)
      sub_data = data[key1]
      return nil unless sub_data
      sub_data[key2]
    end


  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
antlr4ruby-0.1.0 lib/antlr4ruby/misc/double_key_map.rb