cronofy 0.3.1 → 0.3.2

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: fae8db5f6c35b2a0a08accb20ab5cb3b022e349a
4
- data.tar.gz: 5a614083fefe94f1a555dde9044caaeaa828e78c
3
+ metadata.gz: 7c32a02fcae77c417a0f447f8249323e76ada663
4
+ data.tar.gz: 4fab44893e5c7189e712ee2ec63e8f1215e26b09
5
5
  SHA512:
6
- metadata.gz: 50693de9cf548ab27793d6c9b25beeea52a9c6547e678735d01dacc9fb5892f79d4c1f97257d84feba9cf7e56b522645974f0f92033f83498337fb2789b66aea
7
- data.tar.gz: 84fbad2e4bcbacfa81f2fcd26fa9f4d6d30e2f49856f2aaa7917aab15397ad7ea1f0936e5dd91770c04135b19e5616c570efe6b1ec6358c1afffd6487d6f5368
6
+ metadata.gz: 2847a4504e4e17974941c3040749d85d0b477333dd2c0a26cccf1b99e189c57aaa8ce5674a76827bec1090f26bc454ae03545f2ca6de9458fd2eb15d684469e4
7
+ data.tar.gz: 638ec645d4380a93e1653561dc36b6ef56471c0070e9112aaff663a43431f3e6d7ec6642186c88173a11a076a7d08cf8de470e42e660ff2a287288d2e480e897
@@ -134,6 +134,9 @@ module Cronofy
134
134
 
135
135
  coerce_key :start, DateOrTime
136
136
  coerce_key :end, DateOrTime
137
+
138
+ coerce_key :created, ->(v) { Time.iso8601(v) }
139
+ coerce_key :updated, ->(v) { Time.iso8601(v) }
137
140
  end
138
141
 
139
142
  class PagedEventsResult < Hashie::Mash
@@ -1,3 +1,3 @@
1
1
  module Cronofy
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -0,0 +1,55 @@
1
+ require_relative '../../spec_helper'
2
+
3
+ describe Cronofy::Event do
4
+ let(:json) do
5
+ '{
6
+ "calendar_id": "cal_U9uuErStTG@EAAAB_IsAsykA2DBTWqQTf-f0kJw",
7
+ "event_uid": "evt_external_54008b1a4a41730f8d5c6037",
8
+ "summary": "Company Retreat",
9
+ "description": "",
10
+ "start": "2014-09-06",
11
+ "end": "2014-09-08",
12
+ "deleted": false,
13
+ "location": {
14
+ "description": "Beach"
15
+ },
16
+ "participation_status": "needs_action",
17
+ "transparency": "opaque",
18
+ "event_status": "confirmed",
19
+ "categories": [],
20
+ "attendees": [
21
+ {
22
+ "email": "example@cronofy.com",
23
+ "display_name": "Example Person",
24
+ "status": "needs_action"
25
+ }
26
+ ],
27
+ "created": "2014-09-01T08:00:01Z",
28
+ "updated": "2014-09-01T09:24:16Z"
29
+ }'
30
+ end
31
+
32
+ let(:hash) do
33
+ JSON.parse(json)
34
+ end
35
+
36
+ subject do
37
+ Cronofy::Event.new(hash)
38
+ end
39
+
40
+ it "coerces the start date" do
41
+ expect(subject.start).to eq(Cronofy::DateOrTime.coerce("2014-09-06"))
42
+ end
43
+
44
+ it "coerces the end date" do
45
+ expect(subject.end).to eq(Cronofy::DateOrTime.coerce("2014-09-08"))
46
+ end
47
+
48
+ it "coerces the created time" do
49
+ expect(subject.created).to eq(Time.parse("2014-09-01T08:00:01Z"))
50
+ end
51
+
52
+ it "coerces the updated time" do
53
+ expect(subject.updated).to eq(Time.parse("2014-09-01T09:24:16Z"))
54
+ end
55
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Paryzhskyi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-28 00:00:00.000000000 Z
12
+ date: 2015-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -119,6 +119,7 @@ files:
119
119
  - spec/lib/cronofy/client_spec.rb
120
120
  - spec/lib/cronofy/date_or_time_spec.rb
121
121
  - spec/lib/cronofy/errors_spec.rb
122
+ - spec/lib/cronofy/event_spec.rb
122
123
  - spec/response_parser_spec.rb
123
124
  - spec/spec_helper.rb
124
125
  homepage: https://github.com/cronofy/cronofy-ruby
@@ -150,5 +151,6 @@ test_files:
150
151
  - spec/lib/cronofy/client_spec.rb
151
152
  - spec/lib/cronofy/date_or_time_spec.rb
152
153
  - spec/lib/cronofy/errors_spec.rb
154
+ - spec/lib/cronofy/event_spec.rb
153
155
  - spec/response_parser_spec.rb
154
156
  - spec/spec_helper.rb