class Ably::Models::DeviceDetails

Contains the properties of a device registered for push notifications.

Public Class Methods

new(hash_object = {}) click to toggle source

@param hash_object [Hash,nil] Device detail attributes

# 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

Public Instance Methods

attributes() click to toggle source
# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 122
def attributes
  @hash_object
end
client_id() click to toggle source

The client ID the device is connected to Ably with.

@spec PCD3

@return [String]

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 59
def client_id
  attributes[:client_id]
end
device_secret() click to toggle source
# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 74
def device_secret
  attributes[:device_secret]
end
form_factor() click to toggle source

The DeviceFormFactor object associated with the device. Describes the type of the device, such as phone or tablet.

@spec PCD4

@return [String]

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 70
def form_factor
  attributes[:form_factor]
end
id() click to toggle source

A unique ID generated by the device.

@spec PCD2

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 38
def id
  attributes[:id]
end
metadata() click to toggle source

A JSON object of key-value pairs that contains metadata for the device.

@spec PCD5

@return [Hash, nil]

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 93
def metadata
  attributes[:metadata] || {}
end
metadata=(val) click to toggle source
# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 97
def metadata=(val)
  unless val.nil? || val.kind_of?(Hash)
    raise ArgumentError, "metadata must be nil or a Hash value"
  end
  attributes[:metadata] = val
end
platform() click to toggle source

The DevicePlatform associated with the device. Describes the platform the device uses, such as android or ios.

@spec PCD6

@return [String]

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 49
def platform
  attributes[:platform]
end
push() click to toggle source

The {Ably::Models::DevicePushDetails} object associated with the device. Describes the details of the push registration of the device.

@spec PCD7

@return [Ably::Models::DevicePushDetails]

# File lib/submodules/ably-ruby/lib/ably/models/device_details.rb, line 111
def push
  DevicePushDetails(attributes[:push] || {})
end
push=(val) click to toggle source
# 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