Class: Verizon::SearchDeviceByPropertyFields
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::SearchDeviceByPropertyFields
- Defined in:
- lib/verizon/models/search_device_by_property_fields.rb
Overview
List of device sensors and their most recently reported values.
Instance Attribute Summary collapse
-
#acceleration ⇒ Acceleration
TODO: Write general description for this method.
-
#battery ⇒ String
TODO: Write general description for this method.
-
#device_propertylocation ⇒ DevicePropertylocation
TODO: Write general description for this method.
-
#humidity ⇒ String
TODO: Write general description for this method.
-
#light ⇒ String
TODO: Write general description for this method.
-
#pressure ⇒ String
TODO: Write general description for this method.
-
#signal_strength ⇒ String
TODO: Write general description for this method.
-
#temperature ⇒ 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(acceleration = SKIP, battery = SKIP, humidity = SKIP, light = SKIP, pressure = SKIP, signal_strength = SKIP, temperature = SKIP, device_propertylocation = SKIP) ⇒ SearchDeviceByPropertyFields
constructor
A new instance of SearchDeviceByPropertyFields.
Methods inherited from BaseModel
Constructor Details
#initialize(acceleration = SKIP, battery = SKIP, humidity = SKIP, light = SKIP, pressure = SKIP, signal_strength = SKIP, temperature = SKIP, device_propertylocation = SKIP) ⇒ SearchDeviceByPropertyFields
Returns a new instance of SearchDeviceByPropertyFields.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 77 def initialize(acceleration = SKIP, battery = SKIP, humidity = SKIP, light = SKIP, pressure = SKIP, signal_strength = SKIP, temperature = SKIP, device_propertylocation = SKIP) @acceleration = acceleration unless acceleration == SKIP @battery = battery unless battery == SKIP @humidity = humidity unless humidity == SKIP @light = light unless light == SKIP @pressure = pressure unless pressure == SKIP @signal_strength = signal_strength unless signal_strength == SKIP @temperature = temperature unless temperature == SKIP @device_propertylocation = device_propertylocation unless device_propertylocation == SKIP end |
Instance Attribute Details
#acceleration ⇒ Acceleration
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 14 def acceleration @acceleration end |
#battery ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 18 def battery @battery end |
#device_propertylocation ⇒ DevicePropertylocation
TODO: Write general description for this method
42 43 44 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 42 def device_propertylocation @device_propertylocation end |
#humidity ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 22 def humidity @humidity end |
#light ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 26 def light @light end |
#pressure ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 30 def pressure @pressure end |
#signal_strength ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 34 def signal_strength @signal_strength end |
#temperature ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 38 def temperature @temperature end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. acceleration = Acceleration.from_hash(hash['acceleration']) if hash['acceleration'] battery = hash.key?('battery') ? hash['battery'] : SKIP humidity = hash.key?('humidity') ? hash['humidity'] : SKIP light = hash.key?('light') ? hash['light'] : SKIP pressure = hash.key?('pressure') ? hash['pressure'] : SKIP signal_strength = hash.key?('signalStrength') ? hash['signalStrength'] : SKIP temperature = hash.key?('temperature') ? hash['temperature'] : SKIP device_propertylocation = DevicePropertylocation.from_hash(hash['DevicePropertylocation']) if hash['DevicePropertylocation'] # Create object from extracted values. SearchDeviceByPropertyFields.new(acceleration, battery, humidity, light, pressure, signal_strength, temperature, device_propertylocation) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['acceleration'] = 'acceleration' @_hash['battery'] = 'battery' @_hash['humidity'] = 'humidity' @_hash['light'] = 'light' @_hash['pressure'] = 'pressure' @_hash['signal_strength'] = 'signalStrength' @_hash['temperature'] = 'temperature' @_hash['device_propertylocation'] = 'DevicePropertylocation' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/verizon/models/search_device_by_property_fields.rb', line 59 def self.optionals %w[ acceleration battery humidity light pressure signal_strength temperature device_propertylocation ] end |