Sha256: e52b7c3c1b2d237cf07c4ef380f25f9bb6b124c698ca2be7627217245bc64d10

Contents?: true

Size: 334 Bytes

Versions: 21

Compression:

Stored size: 334 Bytes

Contents

module RForce
  # Allows indexing hashes like method calls: hash.key
  # to supplement the traditional way of indexing: hash[key]
  module MethodKeys
    def method_missing(method, *args)
      raise NoMethodError unless respond_to?('[]')
      self[method]
    end
  end
  
  class MethodHash < Hash
    include MethodKeys
  end
end

Version data entries

21 entries across 21 versions & 9 rubygems

Version Path
althor880-activerecord-activesalesforce-adapter-2.3.5 lib/rforce/method_keys.rb