Class: LMC::DeviceDSCUi::Version
- Inherits:
-
Object
- Object
- LMC::DeviceDSCUi::Version
- Defined in:
- lib/lmc/config/device_dsc_ui.rb
Instance Attribute Summary collapse
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
-
#version_string ⇒ Object
readonly
Returns the value of attribute version_string.
Instance Method Summary collapse
-
#initialize(v_hash) ⇒ Version
constructor
A new instance of Version.
- #items ⇒ Object
Constructor Details
#initialize(v_hash) ⇒ Version
Returns a new instance of Version.
30 31 32 33 34 35 36 |
# File 'lib/lmc/config/device_dsc_ui.rb', line 30 def initialize(v_hash) keys = v_hash.keys raise('More than one version key contained in dscui.') if keys.length > 1 @version_string = keys.first @sections = v_hash[@version_string].map { |section_wrapper| Section.new section_wrapper } end |
Instance Attribute Details
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
28 29 30 |
# File 'lib/lmc/config/device_dsc_ui.rb', line 28 def sections @sections end |
#version_string ⇒ Object (readonly)
Returns the value of attribute version_string.
28 29 30 |
# File 'lib/lmc/config/device_dsc_ui.rb', line 28 def version_string @version_string end |
Instance Method Details
#items ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/lmc/config/device_dsc_ui.rb', line 38 def items @sections.map { |s| s.groups.map { |g| g.items } }.flatten.compact end |