Exception: Ably::Models::DevicePushDetails
- Inherits:
-
Exceptions::BaseAblyException
- Object
- StandardError
- Exceptions::BaseAblyException
- Ably::Models::DevicePushDetails
- Includes:
- Ably::Modules::ModelCommon
- Defined in:
- lib/ably/models/device_push_details.rb
Overview
An object with the push notification details for Ably::Modules::Conversions#DeviceDetails object
Instance Attribute Summary collapse
-
#error_reason ⇒ ErrorInfo
If the state is Failing of Failed, this field may optionally contain a reason.
-
#metadata ⇒ Hash
readonly
Arbitrary metadata that can be associated with this object.
-
#state ⇒ String
readonly
The current state of this push target such as Active, Failing or Failed.
-
#transport_type ⇒ String
readonly
Transport type for push notifications such as gcm, apns, web.
Attributes included from Ably::Modules::ModelCommon
Attributes inherited from Exceptions::BaseAblyException
#code, #message, #request_id, #status
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(hash_object = {}) ⇒ DevicePushDetails
constructor
a.
- #recipient ⇒ Object
- #recipient=(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 = {}) ⇒ DevicePushDetails
a
37 38 39 40 |
# File 'lib/ably/models/device_push_details.rb', line 37 def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(@raw_hash_object) end |
Instance Attribute Details
#error_reason ⇒ ErrorInfo
32 33 34 35 36 37 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 |
# File 'lib/ably/models/device_push_details.rb', line 32 class DevicePushDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device push detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(@raw_hash_object) end %w(state).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 recipient attributes[:recipient] || {} end 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 def error_reason attributes[:error_reason] end 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 def attributes @hash_object end end |
#metadata ⇒ Hash (readonly)
32 33 34 35 36 37 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 |
# File 'lib/ably/models/device_push_details.rb', line 32 class DevicePushDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device push detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(@raw_hash_object) end %w(state).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 recipient attributes[:recipient] || {} end 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 def error_reason attributes[:error_reason] end 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 def attributes @hash_object end end |
#state ⇒ String (readonly)
32 33 34 35 36 37 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 |
# File 'lib/ably/models/device_push_details.rb', line 32 class DevicePushDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device push detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(@raw_hash_object) end %w(state).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 recipient attributes[:recipient] || {} end 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 def error_reason attributes[:error_reason] end 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 def attributes @hash_object end end |
#transport_type ⇒ String (readonly)
32 33 34 35 36 37 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 |
# File 'lib/ably/models/device_push_details.rb', line 32 class DevicePushDetails < Ably::Exceptions::BaseAblyException include Ably::Modules::ModelCommon # @param hash_object [Hash,nil] Device push detail attributes #a def initialize(hash_object = {}) @raw_hash_object = hash_object || {} @hash_object = IdiomaticRubyWrapper(@raw_hash_object) end %w(state).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 recipient attributes[:recipient] || {} end 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 def error_reason attributes[:error_reason] end 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 def attributes @hash_object end end |
Instance Method Details
#attributes ⇒ Object
82 83 84 |
# File 'lib/ably/models/device_push_details.rb', line 82 def attributes @hash_object end |
#recipient ⇒ Object
55 56 57 |
# File 'lib/ably/models/device_push_details.rb', line 55 def recipient attributes[:recipient] || {} end |
#recipient=(val) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/ably/models/device_push_details.rb', line 59 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 |