class ConfigMapper::CollectionMapper
Configuration proxy for a collection (e.g. Hash, Array, ConfigDict
)
Public Class Methods
new(hash)
click to toggle source
# File lib/config_mapper/collection_mapper.rb, line 9 def initialize(hash) @hash = hash end
Public Instance Methods
can_set?(key)
click to toggle source
# File lib/config_mapper/collection_mapper.rb, line 25 def can_set?(key) @hash.respond_to?("[]=") end
get(key)
click to toggle source
# File lib/config_mapper/collection_mapper.rb, line 17 def get(key) @hash[key] end
path(key)
click to toggle source
# File lib/config_mapper/collection_mapper.rb, line 13 def path(key) "[#{key.inspect}]" end
set(key, value)
click to toggle source
# File lib/config_mapper/collection_mapper.rb, line 21 def set(key, value) @hash[key] = value end