class Ably::Models::DevicePushDetails

An object with the push notification details for {DeviceDetails} object

Public Class Methods

new(hash_object = {}) click to toggle source

@param hash_object [Hash,nil] Device push detail attributes

# File lib/submodules/ably-ruby/lib/ably/models/device_push_details.rb, line 29
def initialize(hash_object = {})
  @raw_hash_object = hash_object || {}
  @hash_object     = IdiomaticRubyWrapper(@raw_hash_object)
end

Public Instance Methods

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

An {Ably::Models::ErrorInfo} object describing the most recent error when the state is Failing or Failed.

@spec PCP2

@return [Ably::Models::ErrorInfo]

# File lib/submodules/ably-ruby/lib/ably/models/device_push_details.rb, line 74
def error_reason
  attributes[:error_reason]
end
error_reason=(val) click to toggle source
# File lib/submodules/ably-ruby/lib/ably/models/device_push_details.rb, line 78
def error_reason=(val)
  unless val.nil? || val.kind_of?(Hash) || val.kind_of?(Ably::Models::ErrorInfo)
    raise ArgumentError, "error_reason must be nil, a Hash value or a ErrorInfo object"
  end

  attributes[:error_reason] = if val.nil?
    nil
  else
    ErrorInfo(val)
  end
end
recipient() click to toggle source

A JSON object of key-value pairs that contains of the push transport and address.

@spec PCP3

@return [Hash, nil]

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

The current state of the push registration.

@spec PCP4

@return [Symbol]

# File lib/submodules/ably-ruby/lib/ably/models/device_push_details.rb, line 40
def state
  attributes[:state]
end
state=(val) click to toggle source
# File lib/submodules/ably-ruby/lib/ably/models/device_push_details.rb, line 44
def state=(val)
  unless val.nil? || val.kind_of?(String)
    raise ArgumentError, "state must be nil or a string value"
  end
  attributes[:state] = val
end