Class: Ecu::CombinedList
- Inherits:
-
Object
- Object
- Ecu::CombinedList
- Defined in:
- lib/ecu/combined_list.rb,
lib/ecu/interfaces/lab/combined_list.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#signals ⇒ Object
Returns the value of attribute signals.
-
#subheaders ⇒ Object
Returns the value of attribute subheaders.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(signals = SignalList.new, labels = LabelList.new, headers = [], subheaders = []) ⇒ CombinedList
constructor
A new instance of CombinedList.
- #inspect ⇒ Object
- #to_lab ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(signals = SignalList.new, labels = LabelList.new, headers = [], subheaders = []) ⇒ CombinedList
Returns a new instance of CombinedList.
9 10 11 12 13 14 |
# File 'lib/ecu/combined_list.rb', line 9 def initialize(signals=SignalList.new, labels=LabelList.new, headers=[], subheaders=[]) @signals = signals @labels = labels @headers = headers @subheaders = subheaders end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
16 17 18 |
# File 'lib/ecu/combined_list.rb', line 16 def headers @headers end |
#labels ⇒ Object
Returns the value of attribute labels.
16 17 18 |
# File 'lib/ecu/combined_list.rb', line 16 def labels @labels end |
#signals ⇒ Object
Returns the value of attribute signals.
16 17 18 |
# File 'lib/ecu/combined_list.rb', line 16 def signals @signals end |
#subheaders ⇒ Object
Returns the value of attribute subheaders.
16 17 18 |
# File 'lib/ecu/combined_list.rb', line 16 def subheaders @subheaders end |
Class Method Details
Instance Method Details
#inspect ⇒ Object
22 |
# File 'lib/ecu/combined_list.rb', line 22 def inspect; to_s end |
#to_lab ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ecu/interfaces/lab/combined_list.rb', line 11 def to_lab out = [] out.append(*headers.map { |l| "; #{l}" }, "") unless headers.empty? out.append("[SETTINGS]") out.append("Version;V1.1") out.append("MultiRasterSeparator;&") out.append("") out.append(*subheaders.map { |l| "; #{l}" }, "") unless subheaders.empty? out.append("[RAMCELL]") out.append(*signals.map(&:to_lab)) out.append("[Label]") out.append(*labels.map(&:to_lab)) out.join("\n") end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/ecu/combined_list.rb', line 18 def to_s "<CombinedList: #{signals.count} signals, #{labels.count} labels}>" end |