Class: Lsmap_net
- Inherits:
-
Object
- Object
- Lsmap_net
- Defined in:
- lib/VIOS/lsmap_net.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#data_string_raw ⇒ Object
readonly
Returns the value of attribute data_string_raw.
-
#sys ⇒ Object
Returns the value of attribute sys.
-
#vios ⇒ Object
Returns the value of attribute vios.
Instance Method Summary collapse
-
#initialize(string = '', vios = nil, sys = nil) ⇒ Lsmap_net
constructor
A new instance of Lsmap_net.
- #parse(string) ⇒ Object
Constructor Details
#initialize(string = '', vios = nil, sys = nil) ⇒ Lsmap_net
Returns a new instance of Lsmap_net.
12 13 14 15 16 17 18 19 |
# File 'lib/VIOS/lsmap_net.rb', line 12 def initialize(string = '', vios = nil, sys = nil) @vios = vios @sys = sys @data = {} @data_string_raw = '' parse(string) unless string.empty? end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/VIOS/lsmap_net.rb', line 5 def data @data end |
#data_string_raw ⇒ Object (readonly)
Returns the value of attribute data_string_raw.
6 7 8 |
# File 'lib/VIOS/lsmap_net.rb', line 6 def data_string_raw @data_string_raw end |
#sys ⇒ Object
Returns the value of attribute sys.
9 10 11 |
# File 'lib/VIOS/lsmap_net.rb', line 9 def sys @sys end |
#vios ⇒ Object
Returns the value of attribute vios.
8 9 10 |
# File 'lib/VIOS/lsmap_net.rb', line 8 def vios @vios end |
Instance Method Details
#parse(string) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/VIOS/lsmap_net.rb', line 21 def parse(string) @data_string_raw = string string.gsub!("\nSVEA", '--split--SVEA').split('--split--').each do |str| entry = Lsmap_net_entry.new(str) @data[entry.svea] = entry end @data end |