module TivoHMO::Config::Mixin::ClassMethods

Public Instance Methods

config_get(key) click to toggle source
# File lib/tivohmo/config.rb, line 133
def config_get(key)
  scoped_key = config_path << key
  result = Config.instance.get(scoped_key)
  result
end
config_register(key, default_value, description, &on_change_block) click to toggle source
# File lib/tivohmo/config.rb, line 122
def config_register(key, default_value, description, &on_change_block)
  raise ArgumentError, "Config '#{key}' already registered" if Config.instance.known_config[key]

  Config.instance.known_config[key] = {
      default_value: default_value,
      description: description,
      source_path: config_path,
      on_change: on_change_block
  }
end
config_set(key, value) click to toggle source
# File lib/tivohmo/config.rb, line 139
def config_set(key, value)
  Config.instance.set(key, value)
end

Private Instance Methods

config_path() click to toggle source
# File lib/tivohmo/config.rb, line 145
def config_path
  path = self.name.underscore
  path = path.sub(/.*tivo_hmo\//, '')
  pieces = path.split('/')
  pieces
end