ionic_push 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eebe9f021c48ab28d37592de9c95fc27aa9c3438
4
- data.tar.gz: 863d5c8dda6bbd8c3d90736407c5f918416588c8
3
+ metadata.gz: 590d984a1bb6b46d9043bd44a4231aeca2d04a54
4
+ data.tar.gz: 3f8a672edb34314d4102ed0f6f4034c06e2673b8
5
5
  SHA512:
6
- metadata.gz: 1e268804eaca4e0e6fe0fcb619d39217ff357903652910f65e74830dbeabf0c0c4ea445c93cef7a57d5b38b2e202709bf56945c782e257f71814555c5e02a17b
7
- data.tar.gz: d0fe21d80858f6d7b0149e845644e78984ab4e1559f4fcb7c7c81bd583e4f42972ced0a42665e6fa40073b2482e2aa56e5e972bed6b23383f0dd06c8cb1c159a
6
+ metadata.gz: fe7e706d73903ba549189ac9ac61448bded7d74bd0414d3f434a2c7eb2e81008d7ca01aa471873850541cc87c7f7c9ea6ba9a9161f123586a88aa1d09fb9d571
7
+ data.tar.gz: 18f681ed0e308038c97601e69a9561f195bfa9ffd3ced6b6ebadcbf26bc15ed96704e9c8fd304bcf7008dcdddf74311865ac115cd21892fb1690a49ff9da77c3
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
@@ -13,28 +13,38 @@ module IonicPush
13
13
  end
14
14
 
15
15
  def send
16
+ puts request_params
16
17
  self.class.post('/notifications', request_params)
17
18
  end
18
19
 
19
20
  private
20
21
 
21
22
  def headers
22
- auth = "Bearer #{@configuration.api_key}"
23
- { headers: { 'Content-Type': 'application/json', 'Authorization': auth } }
23
+ @options[:headers] = content_type
24
+ @options[:headers].merge!(authorization)
24
25
  end
25
26
 
26
- def body
27
- profile
28
- { body: @data.to_json }
27
+ def content_type
28
+ { 'Content-Type' => 'application/json' }
29
+ end
30
+
31
+ def authorization
32
+ auth = "Bearer #{@configuration.api_key}"
33
+ { 'Authorization' => auth }
29
34
  end
30
35
 
31
- def profile
36
+ def security_profile
32
37
  @data.merge!(profile: @configuration.profile)
33
38
  end
34
39
 
40
+ def body
41
+ @options.merge!(body: @data.to_json)
42
+ end
43
+
35
44
  def request_params
36
- @options.merge!(headers)
37
- @options.merge!(body)
45
+ headers
46
+ security_profile
47
+ body
38
48
  end
39
49
  end
40
50
  end
@@ -1,3 +1,3 @@
1
1
  module IonicPush
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ionic_push
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago F. Lins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty