Class: Maia::FCM::Result

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/maia/fcm/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes, token) ⇒ Result

Returns a new instance of Result.



9
10
11
12
# File 'lib/maia/fcm/result.rb', line 9

def initialize(attributes, token)
  super attributes
  @token = token
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



6
7
8
# File 'lib/maia/fcm/result.rb', line 6

def error
  @error
end

#message_idObject

Returns the value of attribute message_id.



6
7
8
# File 'lib/maia/fcm/result.rb', line 6

def message_id
  @message_id
end

#registration_idObject

Returns the value of attribute registration_id.



6
7
8
# File 'lib/maia/fcm/result.rb', line 6

def registration_id
  @registration_id
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/maia/fcm/result.rb', line 7

def token
  @token
end

Instance Method Details

#canonical_idObject



22
23
24
# File 'lib/maia/fcm/result.rb', line 22

def canonical_id
  registration_id
end

#fail?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/maia/fcm/result.rb', line 18

def fail?
  !success?
end

#has_canonical_id?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/maia/fcm/result.rb', line 26

def has_canonical_id?
  canonical_id.present?
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/maia/fcm/result.rb', line 14

def success?
  message_id.present?
end