Class: CleanHash::MutexHash

Inherits:
Indifferent show all
Defined in:
lib/clean-hash/types/mutex_type.rb

Constant Summary collapse

MUTEX =
Mutex.new

Instance Method Summary collapse

Methods inherited from Indifferent

#[], #delete, #initialize, #key, #key?, #method_missing, #to_ary, #to_h, #to_json

Constructor Details

This class inherits a constructor from CleanHash::Indifferent

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CleanHash::Indifferent

Instance Method Details

#[]=(name, value) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/clean-hash/types/mutex_type.rb', line 6

def []= name, value
  MUTEX.synchronize do
    @data[name] =
    if value.is_a?(Hash)
      self.class.new value
    else
      value
    end
  end
end