Class: PushesUs::Notification

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(network, identity, alert, sound = 'default') ⇒ Notification

Returns a new instance of Notification.



16
17
18
# File 'lib/pushesus.rb', line 16

def initialize(network, identity, alert, sound='default')
  @network, @identity, @alert, @sound = network, identity, alert, sound
end

Instance Attribute Details

#alertObject

Returns the value of attribute alert.



14
15
16
# File 'lib/pushesus.rb', line 14

def alert
  @alert
end

#identityObject

Returns the value of attribute identity.



14
15
16
# File 'lib/pushesus.rb', line 14

def identity
  @identity
end

#networkObject

Returns the value of attribute network.



14
15
16
# File 'lib/pushesus.rb', line 14

def network
  @network
end

#soundObject

Returns the value of attribute sound.



14
15
16
# File 'lib/pushesus.rb', line 14

def sound
  @sound
end

Instance Method Details

#sendObject



20
21
22
23
24
25
26
27
# File 'lib/pushesus.rb', line 20

def send
  PushesUs.post('/notifications.json', :query => { :notification => { 
                                              :identity => identity,
                                              :network => network,
                                              :alert => alert,
                                              :sound => sound
                                             }})
end