push_to_devices 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,16 +5,15 @@ require "cgi"
5
5
  module PushToDevices
6
6
 
7
7
  module Config
8
- VERSION = '0.1.3'
8
+ VERSION = '0.1.4'
9
9
  end
10
10
 
11
11
  class Exception < ::StandardError
12
12
  attr_accessor :response_code, :response_body
13
13
 
14
- # Pretty self explanatory stuff here...
15
14
  def initialize(response_code, response_body)
16
- @response_code = response_code
17
- @response_body = response_body
15
+ self.response_code = response_code
16
+ self.response_body = response_body
18
17
  super "Response was #{response_code}, #{response_body}"
19
18
  end
20
19
  end
@@ -43,7 +42,7 @@ module PushToDevices
43
42
  # Set up the HTTP connection
44
43
  http = generate_http
45
44
 
46
- uri = self.generate_uri_from_params(endpoint, params)
45
+ uri = generate_uri_from_params(endpoint, params)
47
46
 
48
47
  # Set up the request
49
48
  request = Net::HTTP::Get.new(uri)
@@ -59,7 +58,7 @@ module PushToDevices
59
58
  http.request request
60
59
  }
61
60
 
62
- self.handle_response(response)
61
+ handle_response(response)
63
62
  end
64
63
 
65
64
  def post(endpoint, params = {})
@@ -81,7 +80,7 @@ module PushToDevices
81
80
  http.request request
82
81
  }
83
82
 
84
- self.handle_response(response)
83
+ handle_response(response)
85
84
  end
86
85
 
87
86
  def generate_http
@@ -140,7 +139,7 @@ module PushToDevices
140
139
  # GETS to service/me
141
140
  # Returns the body
142
141
  def get_service_info(params = {})
143
- self.get('services/me')
142
+ get('services/me')
144
143
  end
145
144
 
146
145
  # POSTS to users/:unique_hash/notifications
@@ -156,7 +155,7 @@ module PushToDevices
156
155
  # }
157
156
  # }
158
157
  def post_notification_to_user(params = {})
159
- self.post("users/#{params.delete(:unique_hash)}/notifications", params.delete(:notification_data))
158
+ post("users/#{params.delete(:unique_hash)}/notifications", params.delete(:notification_data))
160
159
  end
161
160
 
162
161
  # POSTS to users/notifications
@@ -172,7 +171,7 @@ module PushToDevices
172
171
  # }
173
172
  # }
174
173
  def post_notification_to_users(params = {})
175
- self.post("users/notifications", params)
174
+ post("users/notifications", params)
176
175
  end
177
176
 
178
177
  # POSTS to users/ to register a user for push notifications
@@ -183,7 +182,7 @@ module PushToDevices
183
182
  # gcm_registration_id: gcm_registration_id
184
183
  # }
185
184
  def register_user_for_push(params = {})
186
- self.post("users/", params)
185
+ post("users/", params)
187
186
  end
188
187
  end
189
188
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = %q{push_to_devices}
3
- gem.version = "0.1.3"
3
+ gem.version = "0.1.4"
4
4
  gem.date = %q{2013-02-15}
5
5
  gem.authors = ["Lloyd Meta"]
6
6
  gem.email = ["lloydmeta@gmail.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_to_devices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 1.8.24
115
+ rubygems_version: 1.8.25
116
116
  signing_key:
117
117
  specification_version: 3
118
118
  summary: A Ruby library for interfacing with push_to_devices