Class: TingYun::Configuration::DottedHash
- Inherits:
-
Hash
- Object
- Hash
- TingYun::Configuration::DottedHash
show all
- Defined in:
- lib/ting_yun/configuration/dotted_hash.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(hash, keep_nesting = false) ⇒ DottedHash
Returns a new instance of DottedHash.
14
15
16
17
18
19
|
# File 'lib/ting_yun/configuration/dotted_hash.rb', line 14
def initialize(hash, keep_nesting = false)
self.merge!(hash) if keep_nesting
self.merge!(dot_flattened(hash))
DottedHash.symbolize(self)
end
|
Class Method Details
.symbolize(hash) ⇒ Object
8
9
10
11
12
|
# File 'lib/ting_yun/configuration/dotted_hash.rb', line 8
def self.symbolize(hash)
hash.keys.each do |key|
hash[key.to_sym] = hash.delete(key)
end
end
|
Instance Method Details
#inspect ⇒ Object
21
22
23
|
# File 'lib/ting_yun/configuration/dotted_hash.rb', line 21
def inspect
"#<#{self.class.name}:#{object_id} #{super}>"
end
|
#to_hash ⇒ Object
25
26
27
|
# File 'lib/ting_yun/configuration/dotted_hash.rb', line 25
def to_hash
{}.replace(self)
end
|