Class: MistApi::ConstOtherDeviceModel
- Defined in:
- lib/mist_api/models/const_other_device_model.rb
Overview
ConstOtherDeviceModel Model.
Instance Attribute Summary collapse
-
#display ⇒ String
TODO: Write general description for this method.
-
#model ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
-
#vendor ⇒ String
TODO: Write general description for this method.
-
#vendor_model_id ⇒ String
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(vendor_model_id = SKIP, display = SKIP, model = SKIP, type = SKIP, vendor = SKIP) ⇒ ConstOtherDeviceModel
constructor
A new instance of ConstOtherDeviceModel.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(vendor_model_id = SKIP, display = SKIP, model = SKIP, type = SKIP, vendor = SKIP) ⇒ ConstOtherDeviceModel
Returns a new instance of ConstOtherDeviceModel.
59 60 61 62 63 64 65 66 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 59 def initialize(vendor_model_id = SKIP, display = SKIP, model = SKIP, type = SKIP, vendor = SKIP) @vendor_model_id = vendor_model_id unless vendor_model_id == SKIP @display = display unless display == SKIP @model = model unless model == SKIP @type = type unless type == SKIP @vendor = vendor unless vendor == SKIP end |
Instance Attribute Details
#display ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 18 def display @display end |
#model ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 22 def model @model end |
#type ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 26 def type @type end |
#vendor ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 30 def vendor @vendor end |
#vendor_model_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 14 def vendor_model_id @vendor_model_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. vendor_model_id = hash.key?('_vendor_model_id') ? hash['_vendor_model_id'] : SKIP display = hash.key?('display') ? hash['display'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP vendor = hash.key?('vendor') ? hash['vendor'] : SKIP # Create object from extracted values. ConstOtherDeviceModel.new(vendor_model_id, display, model, type, vendor) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['vendor_model_id'] = '_vendor_model_id' @_hash['display'] = 'display' @_hash['model'] = 'model' @_hash['type'] = 'type' @_hash['vendor'] = 'vendor' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 44 def self.optionals %w[ vendor_model_id display model type vendor ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
96 97 98 99 100 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 96 def inspect class_name = self.class.name.split('::').last "<#{class_name} vendor_model_id: #{@vendor_model_id.inspect}, display: #{@display.inspect},"\ " model: #{@model.inspect}, type: #{@type.inspect}, vendor: #{@vendor.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 |
# File 'lib/mist_api/models/const_other_device_model.rb', line 89 def to_s class_name = self.class.name.split('::').last "<#{class_name} vendor_model_id: #{@vendor_model_id}, display: #{@display}, model:"\ " #{@model}, type: #{@type}, vendor: #{@vendor}>" end |