class ConfigMapper::ObjectMapper

Configuration proxy for an Object.

Public Class Methods

new(object) click to toggle source
# File lib/config_mapper/object_mapper.rb, line 9
def initialize(object)
  @object = object
end

Public Instance Methods

can_set?(key) click to toggle source
# File lib/config_mapper/object_mapper.rb, line 25
def can_set?(key)
  @object.respond_to?("#{key}=")
end
get(key) click to toggle source
# File lib/config_mapper/object_mapper.rb, line 17
def get(key)
  @object.public_send(key.to_s)
end
path(key) click to toggle source
# File lib/config_mapper/object_mapper.rb, line 13
def path(key)
  ".#{key}"
end
set(key, value) click to toggle source
# File lib/config_mapper/object_mapper.rb, line 21
def set(key, value)
  @object.public_send("#{key}=", value)
end