Class: TestPack1::TurbineType
- Defined in:
- lib/test_pack_1/models/turbine_type.rb
Overview
Turbine-specific type information.
Instance Attribute Summary collapse
-
#controller ⇒ String
The model of the turbine controller.
-
#manufacturer ⇒ String
TODO: Write general description for this method.
-
#max_rotor_speed ⇒ Float
The model of the turbine controller.
-
#model ⇒ String
TODO: Write general description for this method.
-
#rated_power ⇒ Integer
The model of the turbine controller.
-
#title ⇒ String
TODO: Write general description for this method.
-
#turbine_type_id ⇒ Integer
TODO: Write general description for this method.
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(turbine_type_id = nil, title = nil, manufacturer = nil, model = nil, controller = nil, rated_power = nil, max_rotor_speed = nil) ⇒ TurbineType
constructor
A new instance of TurbineType.
Methods inherited from BaseModel
Constructor Details
#initialize(turbine_type_id = nil, title = nil, manufacturer = nil, model = nil, controller = nil, rated_power = nil, max_rotor_speed = nil) ⇒ TurbineType
Returns a new instance of TurbineType.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 50 def initialize(turbine_type_id = nil, title = nil, manufacturer = nil, model = nil, controller = nil, rated_power = nil, max_rotor_speed = nil) @turbine_type_id = turbine_type_id @title = title @manufacturer = manufacturer @model = model @controller = controller @rated_power = rated_power @max_rotor_speed = max_rotor_speed end |
Instance Attribute Details
#controller ⇒ String
The model of the turbine controller.
27 28 29 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 27 def controller @controller end |
#manufacturer ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 19 def manufacturer @manufacturer end |
#max_rotor_speed ⇒ Float
The model of the turbine controller.
35 36 37 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 35 def max_rotor_speed @max_rotor_speed end |
#model ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 23 def model @model end |
#rated_power ⇒ Integer
The model of the turbine controller.
31 32 33 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 31 def rated_power @rated_power end |
#title ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 15 def title @title end |
#turbine_type_id ⇒ Integer
TODO: Write general description for this method
11 12 13 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 11 def turbine_type_id @turbine_type_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. turbine_type_id = hash['turbineTypeId'] title = hash['title'] manufacturer = hash['manufacturer'] model = hash['model'] controller = hash['controller'] rated_power = hash['ratedPower'] max_rotor_speed = hash['maxRotorSpeed'] # Create object from extracted values. TurbineType.new(turbine_type_id, title, manufacturer, model, controller, rated_power, max_rotor_speed) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/test_pack_1/models/turbine_type.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['turbine_type_id'] = 'turbineTypeId' @_hash['title'] = 'title' @_hash['manufacturer'] = 'manufacturer' @_hash['model'] = 'model' @_hash['controller'] = 'controller' @_hash['rated_power'] = 'ratedPower' @_hash['max_rotor_speed'] = 'maxRotorSpeed' @_hash end |