Class: LMC::DeviceDSCUi::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/lmc/config/device_dsc_ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sectionsObject (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_stringObject (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

#itemsObject



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