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
An object representing a devices details, used currently for push notifications
Instance Attribute Summary collapse
-
#client_id ⇒ String
readonly
The authenticated client identifier for this device.
-
#device_secret ⇒ String
readonly
This secret is used internally by Ably client libraries to authenticate with Ably when push registration updates are required such as when the GCM token expires and needs renewing.
-
#form_factor ⇒ String
readonly
Device form factor such as phone, tablet, watch.
-
#id ⇒ String
readonly
Unique device identifier assigned randomly by the device.
-
#metadata ⇒ Hash
Arbitrary metadata that can be associated with a device.
-
#platform ⇒ String
readonly
Device platform such as android, ios or browser.
-
#push ⇒ DevicePushDetails
The push notification specific properties for this device allowing push notifications to be delivered to the device.
Attributes included from Ably::Modules::ModelCommon
Attributes inherited from Exceptions::BaseAblyException
#code, #message, #request_id, #status
Instance Method Summary collapse
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
a
43 44 45 46 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 43 def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end |
Instance Attribute Details
#client_id ⇒ String (readonly)
Returns The authenticated client identifier for this device. See auth documentation.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#device_secret ⇒ String (readonly)
Returns This secret is used internally by Ably client libraries to authenticate with Ably when push registration updates are required such as when the GCM token expires and needs renewing.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#form_factor ⇒ String (readonly)
Returns Device form factor such as phone, tablet, watch.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#id ⇒ String (readonly)
Returns Unique device identifier assigned randomly by the device.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#metadata ⇒ Hash
Returns Arbitrary metadata that can be associated with a device.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#platform ⇒ String (readonly)
Returns Device platform such as android, ios or browser.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
#push ⇒ DevicePushDetails
Returns The push notification specific properties for this device allowing push notifications to be delivered to the device.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 38 class DeviceDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(hash_object) end %w(id platform form_factor client_id device_secret).each do |attribute| define_method attribute do attributes[attribute.to_sym] end define_method "#{attribute}=" do |val| unless val.nil? || val.kind_of?(String) raise ArgumentError, "#{attribute} must be nil or a string value" end attributes[attribute.to_sym] = val end end def attributes[:metadata] || {} end def (val) unless val.nil? || val.kind_of?(Hash) raise ArgumentError, "metadata must be nil or a Hash value" end attributes[:metadata] = val end def push DevicePushDetails(attributes[:push] || {}) end 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 def attributes @hash_object end end |
Instance Method Details
#attributes ⇒ Object
83 84 85 |
# File 'lib/submodules/ably-ruby/lib/ably/models/device_details.rb', line 83 def attributes @hash_object end |