Class: TestPack1::DataSignal
- Defined in:
- lib/test_pack_1/models/data_signal.rb
Overview
A data signal.
Instance Attribute Summary collapse
-
#data_signal_id ⇒ Integer
The unique id of a data signal.
-
#title ⇒ String
The unique id of a data signal.
-
#unit ⇒ String
The unique id of a data signal.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(data_signal_id = nil, title = nil, unit = nil) ⇒ DataSignal
constructor
A new instance of DataSignal.
Methods inherited from BaseModel
Constructor Details
#initialize(data_signal_id = nil, title = nil, unit = nil) ⇒ DataSignal
Returns a new instance of DataSignal.
30 31 32 33 34 35 36 |
# File 'lib/test_pack_1/models/data_signal.rb', line 30 def initialize(data_signal_id = nil, title = nil, unit = nil) @data_signal_id = data_signal_id @title = title @unit = unit end |
Instance Attribute Details
#data_signal_id ⇒ Integer
The unique id of a data signal.
11 12 13 |
# File 'lib/test_pack_1/models/data_signal.rb', line 11 def data_signal_id @data_signal_id end |
#title ⇒ String
The unique id of a data signal.
15 16 17 |
# File 'lib/test_pack_1/models/data_signal.rb', line 15 def title @title end |
#unit ⇒ String
The unique id of a data signal.
19 20 21 |
# File 'lib/test_pack_1/models/data_signal.rb', line 19 def unit @unit end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/test_pack_1/models/data_signal.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. data_signal_id = hash['dataSignalId'] title = hash['title'] unit = hash['unit'] # Create object from extracted values. DataSignal.new(data_signal_id, title, unit) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 |
# File 'lib/test_pack_1/models/data_signal.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['data_signal_id'] = 'dataSignalId' @_hash['title'] = 'title' @_hash['unit'] = 'unit' @_hash end |