Class: SML::ProfileObjectHeaderEntry
- Inherits:
-
Object
- Object
- SML::ProfileObjectHeaderEntry
- Defined in:
- lib/ruby-sml/sml-profileobjectheaderentry.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#scaler ⇒ Object
Returns the value of attribute scaler.
-
#unit ⇒ Object
Returns the value of attribute unit.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, unit, scaler) ⇒ ProfileObjectHeaderEntry
constructor
A new instance of ProfileObjectHeaderEntry.
- #to_a ⇒ Object
Constructor Details
#initialize(name, unit, scaler) ⇒ ProfileObjectHeaderEntry
Returns a new instance of ProfileObjectHeaderEntry.
8 9 10 11 12 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 8 def initialize(name, unit, scaler) @name = name @unit = unit @scaler = scaler end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 6 def name @name end |
#scaler ⇒ Object
Returns the value of attribute scaler.
6 7 8 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 6 def scaler @scaler end |
#unit ⇒ Object
Returns the value of attribute unit.
6 7 8 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 6 def unit @unit end |
Class Method Details
.construct(array_rep) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 14 def self.construct(array_rep) return nil if array_rep.nil? name = array_rep.shift unit = array_rep.shift scaler = array_rep.shift array_rep.shift unless scaler.nil? return SML::ProfileObjectHeaderEntry.new(name, unit, scaler) end |
Instance Method Details
#to_a ⇒ Object
23 24 25 26 27 |
# File 'lib/ruby-sml/sml-profileobjectheaderentry.rb', line 23 def to_a result = [] << name << unit << scaler result << :int8 unless scaler.nil? return result end |