Class: ApplicationInsights::Channel::Contracts::Device
- Inherits:
-
JsonSerializable
- Object
- JsonSerializable
- ApplicationInsights::Channel::Contracts::Device
- Defined in:
- lib/application_insights/channel/contracts/device.rb
Overview
Data contract class for type Device.
Instance Method Summary collapse
-
#id ⇒ Object
Gets the id property.
-
#id=(value) ⇒ Object
Sets the id property.
-
#initialize(options = {}) ⇒ Device
constructor
Initializes a new instance of the Device class.
-
#ip ⇒ Object
Gets the ip property.
-
#ip=(value) ⇒ Object
Sets the ip property.
-
#language ⇒ Object
Gets the language property.
-
#language=(value) ⇒ Object
Sets the language property.
-
#locale ⇒ Object
Gets the locale property.
-
#locale=(value) ⇒ Object
Sets the locale property.
-
#model ⇒ Object
Gets the model property.
-
#model=(value) ⇒ Object
Sets the model property.
-
#network ⇒ Object
Gets the network property.
-
#network=(value) ⇒ Object
Sets the network property.
-
#oem_name ⇒ Object
Gets the oem_name property.
-
#oem_name=(value) ⇒ Object
Sets the oem_name property.
-
#os ⇒ Object
Gets the os property.
-
#os=(value) ⇒ Object
Sets the os property.
-
#os_version ⇒ Object
Gets the os_version property.
-
#os_version=(value) ⇒ Object
Sets the os_version property.
-
#role_instance ⇒ Object
Gets the role_instance property.
-
#role_instance=(value) ⇒ Object
Sets the role_instance property.
-
#role_name ⇒ Object
Gets the role_name property.
-
#role_name=(value) ⇒ Object
Sets the role_name property.
-
#screen_resolution ⇒ Object
Gets the screen_resolution property.
-
#screen_resolution=(value) ⇒ Object
Sets the screen_resolution property.
-
#type ⇒ Object
Gets the type property.
-
#type=(value) ⇒ Object
Sets the type property.
-
#vm_name ⇒ Object
Gets the vm_name property.
-
#vm_name=(value) ⇒ Object
Sets the vm_name property.
Methods inherited from JsonSerializable
Constructor Details
#initialize(options = {}) ⇒ Device
Initializes a new instance of the Device class.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/application_insights/channel/contracts/device.rb', line 9 def initialize(={}) defaults = { 'ai.device.id' => nil, 'ai.device.ip' => nil, 'ai.device.language' => nil, 'ai.device.locale' => nil, 'ai.device.model' => nil, 'ai.device.network' => nil, 'ai.device.oemName' => nil, 'ai.device.os' => nil, 'ai.device.osVersion' => nil, 'ai.device.roleInstance' => nil, 'ai.device.roleName' => nil, 'ai.device.screenResolution' => nil, 'ai.device.type' => nil, 'ai.device.vmName' => nil } values = { } super defaults, values, end |
Instance Method Details
#id ⇒ Object
Gets the id property.
32 33 34 35 36 |
# File 'lib/application_insights/channel/contracts/device.rb', line 32 def id @values.fetch('ai.device.id') { @values['ai.device.id'] = nil } end |
#id=(value) ⇒ Object
Sets the id property.
39 40 41 42 43 44 45 |
# File 'lib/application_insights/channel/contracts/device.rb', line 39 def id=(value) if value == @defaults['ai.device.id'] @values.delete 'ai.device.id' if @values.key? 'ai.device.id' else @values['ai.device.id'] = value end end |
#ip ⇒ Object
Gets the ip property.
48 49 50 51 52 |
# File 'lib/application_insights/channel/contracts/device.rb', line 48 def ip @values.fetch('ai.device.ip') { @values['ai.device.ip'] = nil } end |
#ip=(value) ⇒ Object
Sets the ip property.
55 56 57 58 59 60 61 |
# File 'lib/application_insights/channel/contracts/device.rb', line 55 def ip=(value) if value == @defaults['ai.device.ip'] @values.delete 'ai.device.ip' if @values.key? 'ai.device.ip' else @values['ai.device.ip'] = value end end |
#language ⇒ Object
Gets the language property.
64 65 66 67 68 |
# File 'lib/application_insights/channel/contracts/device.rb', line 64 def language @values.fetch('ai.device.language') { @values['ai.device.language'] = nil } end |
#language=(value) ⇒ Object
Sets the language property.
71 72 73 74 75 76 77 |
# File 'lib/application_insights/channel/contracts/device.rb', line 71 def language=(value) if value == @defaults['ai.device.language'] @values.delete 'ai.device.language' if @values.key? 'ai.device.language' else @values['ai.device.language'] = value end end |
#locale ⇒ Object
Gets the locale property.
80 81 82 83 84 |
# File 'lib/application_insights/channel/contracts/device.rb', line 80 def locale @values.fetch('ai.device.locale') { @values['ai.device.locale'] = nil } end |
#locale=(value) ⇒ Object
Sets the locale property.
87 88 89 90 91 92 93 |
# File 'lib/application_insights/channel/contracts/device.rb', line 87 def locale=(value) if value == @defaults['ai.device.locale'] @values.delete 'ai.device.locale' if @values.key? 'ai.device.locale' else @values['ai.device.locale'] = value end end |
#model ⇒ Object
Gets the model property.
96 97 98 99 100 |
# File 'lib/application_insights/channel/contracts/device.rb', line 96 def model @values.fetch('ai.device.model') { @values['ai.device.model'] = nil } end |
#model=(value) ⇒ Object
Sets the model property.
103 104 105 106 107 108 109 |
# File 'lib/application_insights/channel/contracts/device.rb', line 103 def model=(value) if value == @defaults['ai.device.model'] @values.delete 'ai.device.model' if @values.key? 'ai.device.model' else @values['ai.device.model'] = value end end |
#network ⇒ Object
Gets the network property.
112 113 114 115 116 |
# File 'lib/application_insights/channel/contracts/device.rb', line 112 def network @values.fetch('ai.device.network') { @values['ai.device.network'] = nil } end |
#network=(value) ⇒ Object
Sets the network property.
119 120 121 122 123 124 125 |
# File 'lib/application_insights/channel/contracts/device.rb', line 119 def network=(value) if value == @defaults['ai.device.network'] @values.delete 'ai.device.network' if @values.key? 'ai.device.network' else @values['ai.device.network'] = value end end |
#oem_name ⇒ Object
Gets the oem_name property.
128 129 130 131 132 |
# File 'lib/application_insights/channel/contracts/device.rb', line 128 def oem_name @values.fetch('ai.device.oemName') { @values['ai.device.oemName'] = nil } end |
#oem_name=(value) ⇒ Object
Sets the oem_name property.
135 136 137 138 139 140 141 |
# File 'lib/application_insights/channel/contracts/device.rb', line 135 def oem_name=(value) if value == @defaults['ai.device.oemName'] @values.delete 'ai.device.oemName' if @values.key? 'ai.device.oemName' else @values['ai.device.oemName'] = value end end |
#os ⇒ Object
Gets the os property.
144 145 146 147 148 |
# File 'lib/application_insights/channel/contracts/device.rb', line 144 def os @values.fetch('ai.device.os') { @values['ai.device.os'] = nil } end |
#os=(value) ⇒ Object
Sets the os property.
151 152 153 154 155 156 157 |
# File 'lib/application_insights/channel/contracts/device.rb', line 151 def os=(value) if value == @defaults['ai.device.os'] @values.delete 'ai.device.os' if @values.key? 'ai.device.os' else @values['ai.device.os'] = value end end |
#os_version ⇒ Object
Gets the os_version property.
160 161 162 163 164 |
# File 'lib/application_insights/channel/contracts/device.rb', line 160 def os_version @values.fetch('ai.device.osVersion') { @values['ai.device.osVersion'] = nil } end |
#os_version=(value) ⇒ Object
Sets the os_version property.
167 168 169 170 171 172 173 |
# File 'lib/application_insights/channel/contracts/device.rb', line 167 def os_version=(value) if value == @defaults['ai.device.osVersion'] @values.delete 'ai.device.osVersion' if @values.key? 'ai.device.osVersion' else @values['ai.device.osVersion'] = value end end |
#role_instance ⇒ Object
Gets the role_instance property.
176 177 178 179 180 |
# File 'lib/application_insights/channel/contracts/device.rb', line 176 def role_instance @values.fetch('ai.device.roleInstance') { @values['ai.device.roleInstance'] = nil } end |
#role_instance=(value) ⇒ Object
Sets the role_instance property.
183 184 185 186 187 188 189 |
# File 'lib/application_insights/channel/contracts/device.rb', line 183 def role_instance=(value) if value == @defaults['ai.device.roleInstance'] @values.delete 'ai.device.roleInstance' if @values.key? 'ai.device.roleInstance' else @values['ai.device.roleInstance'] = value end end |
#role_name ⇒ Object
Gets the role_name property.
192 193 194 195 196 |
# File 'lib/application_insights/channel/contracts/device.rb', line 192 def role_name @values.fetch('ai.device.roleName') { @values['ai.device.roleName'] = nil } end |
#role_name=(value) ⇒ Object
Sets the role_name property.
199 200 201 202 203 204 205 |
# File 'lib/application_insights/channel/contracts/device.rb', line 199 def role_name=(value) if value == @defaults['ai.device.roleName'] @values.delete 'ai.device.roleName' if @values.key? 'ai.device.roleName' else @values['ai.device.roleName'] = value end end |
#screen_resolution ⇒ Object
Gets the screen_resolution property.
208 209 210 211 212 |
# File 'lib/application_insights/channel/contracts/device.rb', line 208 def screen_resolution @values.fetch('ai.device.screenResolution') { @values['ai.device.screenResolution'] = nil } end |
#screen_resolution=(value) ⇒ Object
Sets the screen_resolution property.
215 216 217 218 219 220 221 |
# File 'lib/application_insights/channel/contracts/device.rb', line 215 def screen_resolution=(value) if value == @defaults['ai.device.screenResolution'] @values.delete 'ai.device.screenResolution' if @values.key? 'ai.device.screenResolution' else @values['ai.device.screenResolution'] = value end end |
#type ⇒ Object
Gets the type property.
224 225 226 227 228 |
# File 'lib/application_insights/channel/contracts/device.rb', line 224 def type @values.fetch('ai.device.type') { @values['ai.device.type'] = nil } end |
#type=(value) ⇒ Object
Sets the type property.
231 232 233 234 235 236 237 |
# File 'lib/application_insights/channel/contracts/device.rb', line 231 def type=(value) if value == @defaults['ai.device.type'] @values.delete 'ai.device.type' if @values.key? 'ai.device.type' else @values['ai.device.type'] = value end end |
#vm_name ⇒ Object
Gets the vm_name property.
240 241 242 243 244 |
# File 'lib/application_insights/channel/contracts/device.rb', line 240 def vm_name @values.fetch('ai.device.vmName') { @values['ai.device.vmName'] = nil } end |
#vm_name=(value) ⇒ Object
Sets the vm_name property.
247 248 249 250 251 252 253 |
# File 'lib/application_insights/channel/contracts/device.rb', line 247 def vm_name=(value) if value == @defaults['ai.device.vmName'] @values.delete 'ai.device.vmName' if @values.key? 'ai.device.vmName' else @values['ai.device.vmName'] = value end end |