Class: IonicNotification::SentNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/ionic_notification/sent_notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SentNotification

Returns a new instance of SentNotification.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ionic_notification/sent_notification.rb', line 6

def initialize(options = {})
  @tokens = options[:tokens]
  @title = options[:title]
  @message = options[:message]
  @android_payload = options[:android_payload]
  @ios_payload = options[:ios_payload]
  @production = options[:production]
  @result = options[:result]
  @message_id = options[:message_id]
  @sent_at = Time.now
  @scheduled = init_scheduled(options[:scheduled])
end

Instance Attribute Details

#android_payloadObject

Returns the value of attribute android_payload.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def android_payload
  @android_payload
end

#ios_payloadObject

Returns the value of attribute ios_payload.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def ios_payload
  @ios_payload
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def message
  @message
end

#message_idObject

Returns the value of attribute message_id.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def message_id
  @message_id
end

#productionObject

Returns the value of attribute production.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def production
  @production
end

#resultObject

Returns the value of attribute result.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def result
  @result
end

#sent_atObject

Returns the value of attribute sent_at.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def sent_at
  @sent_at
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def title
  @title
end

#tokensObject

Returns the value of attribute tokens.



3
4
5
# File 'lib/ionic_notification/sent_notification.rb', line 3

def tokens
  @tokens
end

Instance Method Details

#statusObject



19
20
21
22
# File 'lib/ionic_notification/sent_notification.rb', line 19

def status
  service = StatusService.new @message_id
  service.check_status!
end