Class: FiveMobilePush::Client
- Inherits:
-
Object
- Object
- FiveMobilePush::Client
- Defined in:
- lib/five_mobile_push/client.rb
Constant Summary collapse
- DEFAULT_ENDPOINT =
'https://push.fivemobile.com/rest'
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#application_uid ⇒ Object
Returns the value of attribute application_uid.
Instance Method Summary collapse
- #device(device_uid, device_token = nil) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #notifier ⇒ Object
- #post(path, options = {}) ⇒ Object
- #tag(device_uid, device_token) ⇒ Object
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(={}) self.application_uid = [:application_uid] || FiveMobilePush.application_uid self.api_token = [:api_token] || FiveMobilePush.api_token end |
Instance Attribute Details
#api_token ⇒ Object
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_uid ⇒ Object
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, ={}) perform_request(:get, path, ) end |
#notifier ⇒ Object
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, ={}) perform_request(:post, path, ) 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 |