Class: EleetScript::ProcessedKeyHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/util/processed_key_hash.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ProcessedKeyHash

Returns a new instance of ProcessedKeyHash.



3
4
5
6
# File 'lib/util/processed_key_hash.rb', line 3

def initialize(*args)
  super(*args)
  @key_preprocessor = nil
end

Instance Method Details

#[](key) ⇒ Object



14
15
16
17
# File 'lib/util/processed_key_hash.rb', line 14

def [](key)
  key = adjust(key)
  super(key)
end

#[]=(key, value) ⇒ Object



19
20
21
22
# File 'lib/util/processed_key_hash.rb', line 19

def []=(key, value)
  key = adjust(key)
  super(key, value)
end

#set_key_preprocessor(&block) ⇒ Object



8
9
10
11
12
# File 'lib/util/processed_key_hash.rb', line 8

def set_key_preprocessor(&block)
  if block_given?
    @key_preprocessor = block
  end
end