class Names
Public Class Methods
new()
click to toggle source
# File lib/rsettings/core/names.rb, line 4 def initialize @opts = {} end
Public Instance Methods
add(opts={})
click to toggle source
# File lib/rsettings/core/names.rb, line 8 def add(opts={}) notify :adding, opts @opts.merge!(opts.invert) end
for(setting)
click to toggle source
# File lib/rsettings/core/names.rb, line 13 def for(setting) notify :finding, setting @opts[setting.to_s] || @opts[setting.to_sym] || setting end
inspect()
click to toggle source
# File lib/rsettings/core/names.rb, line 22 def inspect @opts.map do |k,v| "setting <#{k}> is translated from <#{v}>" end.join "\n" end
reverse_for(name)
click to toggle source
# File lib/rsettings/core/names.rb, line 18 def reverse_for(name) @opts.invert[name.value] || name.value end