Sha256: 6e5abc571918477feb7d9a65dba8727ff1ba52c2f27ce3702a3d608daf81b02f
Contents?: true
Size: 813 Bytes
Versions: 123
Compression:
Stored size: 813 Bytes
Contents
# frozen_string_literal: true require 'addressable' module Addressable class URI # @return [ActiveSupport:HashWithIndifferentAccess] def hash_query_values (query_values || {}).with_indifferent_access end def query_value(*args) if args.count == 1 query_value_get(*args) elsif args.count == 2 query_value_set(*args) else raise ::ArgumentError, "#{object.class}.#{__method__}: wrong number of arguments" \ " (given #{args.count}, expected 1..2)" end end private def query_value_get(name) hash_query_values[name] end def query_value_set(name, value) new_query_values = hash_query_values new_query_values[name] = value self.query_values = new_query_values self end end end
Version data entries
123 entries across 123 versions & 2 rubygems