pebble_timeline 0.0.2 → 0.0.3

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: 9ae2a05e63d6905acd6ff98edff0bde495c2b838
4
- data.tar.gz: 05a46e7eabf8eeec8f53ea61e634a8037c2efddf
3
+ metadata.gz: b9f963dfdcfe444374718db5508c0642afb794d0
4
+ data.tar.gz: 7f4201115b6e339698823d7c880edc55c2ac6154
5
5
  SHA512:
6
- metadata.gz: e3e64dc07bea1d58a7125767627cffff896ab15c88a1d2cab2ac56ae1d9812296a9a67f8ea38dfbb9d2d3b85cc77b061f0c21f6e9cb13e98c25803b45f2b4074
7
- data.tar.gz: ef3663e3defbe73dde4612a70bf023b2ebaca70ba3db898bff4786332253dc9e4c5c280116ee16711b78636db9ccdda46c0d54c6ba84e3d202decefbfc027197
6
+ metadata.gz: 8466a192ee66f3b3cb3dc90b101fd97742bc15d0ddaeb61a902fa7fe12ccbef495a047958803aadafaac2843c44c51df71dc2e9789d02f3757a48e1e61665eeb
7
+ data.tar.gz: eda34eb53e0dd988fddd88dc6a1df9b7b6082c06bd581a8247e0e2e1779310f2da10459a1d0150928d034302a8ec218157ec5486da38f7efa3ed03244fa4f0cf
data/README.md CHANGED
@@ -23,17 +23,22 @@ Or install it yourself as:
23
23
  ```
24
24
  require 'pebble_timeline'
25
25
 
26
- api = PebbleTimeline::API.new(ENV['PEBBLE_TIMELINE_API_KEY'])
26
+ api = PebbleTimeline::API.new(API_KEY)
27
27
 
28
28
  # Shared pins
29
29
  pins = PebbleTimeline::Pins.new(api)
30
- pins.create(id: "test-1", topics: 'test', time: "2015-06-10T08:01:10.229Z", layout: { type: 'genericPin', title: 'test 1' })
30
+ pins.create(id: "test-1", topics: 'test', time: "2015-06-19T20:00:00Z", layout: { type: 'genericPin', title: 'test 1' })
31
+ pins.update("test-1", topics: 'test', time: "2015-06-19T20:00:00Z", layout: { type: 'genericPin', title: 'test 1' })
31
32
  pins.delete("test-1")
32
33
 
33
34
  # User pins
34
35
  user_pins = PebbleTimeline::Pins.new(api, 'user', USER_TOKEN)
35
36
  user_pins.create(id: "test-1", time: "2015-06-12T16:42:00Z", layout: { type: 'genericPin', title: 'test 1' })
36
37
  user_pins.delete("test-1")
38
+
39
+ # Subscriptions
40
+ subscriptions = PebbleTimeline::Subscriptions.new(api)
41
+ subscriptions.get(USER_TOKEN)
37
42
  ```
38
43
 
39
44
  ## Contributing
@@ -42,7 +42,10 @@ module PebbleTimeline
42
42
  end
43
43
 
44
44
  def get(path, params)
45
- connection.get(resource_url(path), params)
45
+ connection.get do |req|
46
+ req.url resource_url(path)
47
+ req.headers['X-User-Token'] = params.delete(:user_token) if params.has_key? :user_token
48
+ end
46
49
  end
47
50
 
48
51
  def delete(path, params)
@@ -8,6 +8,7 @@ module PebbleTimeline
8
8
 
9
9
  property :title
10
10
  property :type
11
+ property :launchCode
11
12
  end
12
13
  end
13
14
  end
@@ -6,6 +6,7 @@ module PebbleTimeline
6
6
  class LayoutRepresenter < Roar::Decorator
7
7
  include Roar::JSON
8
8
 
9
+ # The type field is always required to determine the type of layout being displayed.
9
10
  property :type
10
11
  property :title
11
12
  property :shortTitle
@@ -14,6 +15,28 @@ module PebbleTimeline
14
15
  property :tinyIcon
15
16
  property :smallIcon
16
17
  property :largeIcon
18
+
19
+ # The following attributes are also available for all pin layout types (excluding notifications and reminders).
20
+ property :primaryColor
21
+ property :secondaryColor
22
+ property :backgroundColor
23
+ property :headings
24
+ property :paragraphs
25
+ property :lastUpdated
26
+
27
+ # Calendar Layout & Weather Layout & Generic Reminder
28
+ property :locationName
29
+
30
+ # Sports Layout
31
+ property :rankAway
32
+ property :rankHome
33
+ property :nameAway
34
+ property :nameHome
35
+ property :recordAway
36
+ property :recordHome
37
+ property :scoreAway
38
+ property :scoreHome
39
+ property :sportsGameState
17
40
  end
18
41
  end
19
42
  end
@@ -0,0 +1,11 @@
1
+ module PebbleTimeline
2
+ class Subscriptions
3
+ def initialize(master)
4
+ @master = master
5
+ end
6
+
7
+ def get(user_token)
8
+ JSON.load @master.call("user/subscriptions", :get, { user_token: user_token })
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module PebbleTimeline
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -17,6 +17,7 @@ require 'pebble_timeline/representer/notification'
17
17
  require 'pebble_timeline/representer/pin'
18
18
 
19
19
  require 'pebble_timeline/pins'
20
+ require 'pebble_timeline/subscriptions'
20
21
  require 'pebble_timeline/api'
21
22
 
22
23
  module PebbleTimeline
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebble_timeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salim Hbeiliny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -158,6 +158,7 @@ files:
158
158
  - lib/pebble_timeline/representer/notification.rb
159
159
  - lib/pebble_timeline/representer/pin.rb
160
160
  - lib/pebble_timeline/representer/reminder.rb
161
+ - lib/pebble_timeline/subscriptions.rb
161
162
  - lib/pebble_timeline/version.rb
162
163
  - pebble_timeline.gemspec
163
164
  homepage: ''