Class: FiveMobilePush::Client

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

Constant Summary collapse

DEFAULT_ENDPOINT =
'https://push.fivemobile.com/rest'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
13
# File 'lib/five_mobile_push/client.rb', line 10

def initialize(options={})
  self.application_uid = options[:application_uid] || FiveMobilePush.application_uid
  self.api_token       = options[:api_token]       || FiveMobilePush.api_token
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



8
9
10
# File 'lib/five_mobile_push/client.rb', line 8

def api_token
  @api_token
end

#application_uidObject

Returns the value of attribute application_uid.



8
9
10
# File 'lib/five_mobile_push/client.rb', line 8

def application_uid
  @application_uid
end

Instance Method Details

#device(device_uid, device_token = nil) ⇒ Object



23
24
25
# File 'lib/five_mobile_push/client.rb', line 23

def device(device_uid, device_token=nil)
  FiveMobilePush::Device.new(self, device_uid, device_token)
end

#get(path, options = {}) ⇒ Object



15
16
17
# File 'lib/five_mobile_push/client.rb', line 15

def get(path, options={})
  perform_request(:get, path, options)
end

#notifierObject



27
28
29
# File 'lib/five_mobile_push/client.rb', line 27

def notifier
  FiveMobilePush::Notifier.new(self)
end

#post(path, options = {}) ⇒ Object



19
20
21
# File 'lib/five_mobile_push/client.rb', line 19

def post(path, options={})
  perform_request(:post, path, options)
end

#tag(device_uid, device_token) ⇒ Object



31
32
33
# File 'lib/five_mobile_push/client.rb', line 31

def tag(device_uid, device_token)
  FiveMobilePush::Tag.new(self, device_uid, device_token)
end