Class: Store::DataMapper::Memory::HashDupper
- Inherits:
-
Object
- Object
- Store::DataMapper::Memory::HashDupper
- Defined in:
- lib/store/memory.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dup ⇒ Object
-
#initialize(hash) ⇒ HashDupper
constructor
A new instance of HashDupper.
Constructor Details
#initialize(hash) ⇒ HashDupper
Returns a new instance of HashDupper.
73 74 75 |
# File 'lib/store/memory.rb', line 73 def initialize(hash) @hash = hash end |
Class Method Details
.dup(hash) ⇒ Object
69 70 71 |
# File 'lib/store/memory.rb', line 69 def self.dup(hash) new(hash).dup end |
Instance Method Details
#dup ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/store/memory.rb', line 77 def dup Hash.new.tap do |dupped_hash| @hash.each do |key, value| dupped_hash[key] = dup_obj(value) end end end |