Exception: Ably::Models::DeviceDetails
- Inherits:
-
Exceptions::BaseAblyException
- Object
- StandardError
- Exceptions::BaseAblyException
- Ably::Models::DeviceDetails
- Includes:
- Ably::Modules::ModelCommon
- Defined in:
- lib/submodules/ably-ruby/lib/ably/models/device_details.rb
Overview
Contains the properties of a device registered for push notifications.
Instance Attribute Summary
Attributes included from Ably::Modules::ModelCommon
Attributes inherited from Exceptions::BaseAblyException
#code, #message, #request_id, #status
Instance Method Summary collapse
- #attributes ⇒ Object
-
#client_id ⇒ String
The client ID the device is connected to Ably with.
- #device_secret ⇒ Object
-
#form_factor ⇒ String
The DeviceFormFactor object associated with the device.
-
#id ⇒ Object
A unique ID generated by the device.
-
#initialize(hash_object = {}) ⇒ DeviceDetails
constructor
A new instance of DeviceDetails.
-
#metadata ⇒ Hash?
A JSON object of key-value pairs that contains metadata for the device.
- #metadata=(val) ⇒ Object
-
#platform ⇒ String
The DevicePlatform associated with the device.
-
#push ⇒ Ably::Models::DevicePushDetails
The DevicePushDetails object associated with the device.
- #push=(val) ⇒ Object
Methods included from Ably::Modules::ModelCommon
#==, #[], #as_json, included, #to_json, #to_s
Methods included from Ably::Modules::MessagePack
Methods inherited from Exceptions::BaseAblyException
Constructor Details
#initialize(hash_object = {}) ⇒ DeviceDetails
Returns a new instance of DeviceDetails.
29 30 31 32 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 29 def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end |
Instance Method Details
#attributes ⇒ Object
122 123 124 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 122 def attributes @hash_object end |
#client_id ⇒ String
The client ID the device is connected to Ably with.
59 60 61 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 59 def client_id attributes[:client_id] end |
#device_secret ⇒ Object
74 75 76 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 74 def device_secret attributes[:device_secret] end |
#form_factor ⇒ String
The DeviceFormFactor object associated with the device. Describes the type of the device, such as phone or tablet.
70 71 72 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 70 def form_factor attributes[:form_factor] end |
#id ⇒ Object
A unique ID generated by the device.
38 39 40 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 def id attributes[:id] end |
#metadata ⇒ Hash?
A JSON object of key-value pairs that contains metadata for the device.
93 94 95 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 93 def attributes[:metadata] || {} end |
#metadata=(val) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 97 def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end |
#platform ⇒ String
The DevicePlatform associated with the device. Describes the platform the device uses, such as android or ios.
49 50 51 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 49 def platform attributes[:platform] end |
#push ⇒ Ably::Models::DevicePushDetails
The Ably::Models::DevicePushDetails object associated with the device. Describes the details of the push registration of the device.
111 112 113 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 111 def push DevicePushDetails(attributes[:push] || {}) end |
#push=(val) ⇒ Object
115 116 117 118 119 120 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 115 def push=(val) unless val.nil? || val.kind_of?(Hash) || val.kind_of?(Ably::Models::DevicePushDetails) raise ArgumentError, "push must be nil, a Hash value or a DevicePushDetails object" end attributes[:push] = DevicePushDetails(val) end |