Sha256: c1e3cbadd557e34fc56c7d0b0953ee81c7810d320d9f6634a3770b39c3745dfd
Contents?: true
Size: 446 Bytes
Versions: 4
Compression:
Stored size: 446 Bytes
Contents
module Gitlab # Converts hashes to the objects. class ObjectifiedHash # Creates a new ObjectifiedHash. def initialize(hash) @data = hash.inject({}) do |data, (key,value)| value = ObjectifiedHash.new(value) if value.is_a? Hash data[key.to_s] = value data end end # Delegate to ObjectifiedHash def method_missing(key) @data.key?(key.to_s) ? @data[key.to_s] : nil end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
gitlab-3.0.0 | lib/gitlab/objectified_hash.rb |
gitlab-2.2.0 | lib/gitlab/objectified_hash.rb |
gitlab-2.1.0 | lib/gitlab/objectified_hash.rb |
gitlab-2.0.0 | lib/gitlab/objectified_hash.rb |