Class: TivoHMO::Adapters::Settings::KeyContainer
- Inherits:
-
Object
- Object
- TivoHMO::Adapters::Settings::KeyContainer
- Includes:
- GemLogger::LoggerSupport, MonitorMixin, TivoHMO::API::Container
- Defined in:
- lib/tivohmo/adapters/settings/key_container.rb
Overview
A Container for config keys
Instance Attribute Summary
Attributes included from TivoHMO::API::Container
Attributes included from TivoHMO::API::Node
#app, #content_type, #created_at, #identifier, #modified_at, #parent, #root, #source_format, #title
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(key) ⇒ KeyContainer
constructor
A new instance of KeyContainer.
Methods included from TivoHMO::API::Container
Methods included from TivoHMO::API::Node
#add_child, #app?, #find, #root?, #title_path, #to_s, #tree_string
Constructor Details
#initialize(key) ⇒ KeyContainer
Returns a new instance of KeyContainer.
11 12 13 14 |
# File 'lib/tivohmo/adapters/settings/key_container.rb', line 11 def initialize(key) super(key) self.presorted = true end |
Instance Method Details
#children ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/tivohmo/adapters/settings/key_container.rb', line 16 def children synchronize do if super.blank? spec = Config.instance.known_config[identifier] add_child(DisplayItem.new("Help", spec[:description])) add_child(DisplayItem.new("Default Value: #{spec[:default_value]}")) val = Config.instance.get(identifier) add_child(DisplayItem.new("Current Value: #{!!val}")) add_child(SetValueItem.new(identifier, !val)) end end super end |