ecal_client 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.
- checksums.yaml +4 -4
- data/lib/ecal_client/api.rb +13 -7
- data/lib/ecal_client/api/rest.rb +2 -3
- data/lib/ecal_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8ba2d1121ced6bf4be80e6b4b47580da459e431e
|
|
4
|
+
data.tar.gz: 8c89bce58712f71a0dbda24eea460f2b8bd10c77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94a533bc930d99e8f6a0d09a7eda192325f422a976783c50995388c68e38fbe7531286545ecb91e8b30a8e52acb94c3278be4045d2e92271709af4cd786a67e2
|
|
7
|
+
data.tar.gz: 323b58d69e57e99748eb188ab0f0eb1ba9f47de0e182dd1fbed18110fdd9de2a4b1e18ab22d90df7b7680dd3f37d0fe8f6fb585afe384beb1b8406ed2940e06d
|
data/lib/ecal_client/api.rb
CHANGED
|
@@ -10,31 +10,37 @@ module EcalClient
|
|
|
10
10
|
SUBSCRIBER = "/subscriber/".freeze
|
|
11
11
|
|
|
12
12
|
def initialize(options = {})
|
|
13
|
-
@
|
|
13
|
+
@key = options.delete(:key) || EcalClient.configuration.key
|
|
14
|
+
@secret = options.delete(:secret) || EcalClient.configuration.secret
|
|
15
|
+
EcalClient.configuration.options.merge!(options)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def credentials
|
|
19
|
+
{ key: @key, secret: @secret }
|
|
14
20
|
end
|
|
15
21
|
|
|
16
22
|
def organisation
|
|
17
|
-
@organisation ||= Rest.new(endpoint_for(ORGANISATION), [:get, :post, :put],
|
|
23
|
+
@organisation ||= Rest.new(endpoint_for(ORGANISATION), [:get, :post, :put], credentials)
|
|
18
24
|
end
|
|
19
25
|
|
|
20
26
|
def publisher
|
|
21
|
-
@publisher ||= Rest.new(endpoint_for(PUBLISHER), [:get, :put],
|
|
27
|
+
@publisher ||= Rest.new(endpoint_for(PUBLISHER), [:get, :put], credentials)
|
|
22
28
|
end
|
|
23
29
|
|
|
24
30
|
def calendar
|
|
25
|
-
@calendar ||= Rest.new(endpoint_for(CALENDAR), [:get, :post, :put],
|
|
31
|
+
@calendar ||= Rest.new(endpoint_for(CALENDAR), [:get, :post, :put], credentials)
|
|
26
32
|
end
|
|
27
33
|
|
|
28
34
|
def event
|
|
29
|
-
@event ||= Rest.new(endpoint_for(EVENT), [:get, :post, :put],
|
|
35
|
+
@event ||= Rest.new(endpoint_for(EVENT), [:get, :post, :put], credentials)
|
|
30
36
|
end
|
|
31
37
|
|
|
32
38
|
def subscription_widget
|
|
33
|
-
@subscription_widget ||= Rest.new(endpoint_for(SUBSCRIPTION_WIDGET), [:get],
|
|
39
|
+
@subscription_widget ||= Rest.new(endpoint_for(SUBSCRIPTION_WIDGET), [:get], credentials)
|
|
34
40
|
end
|
|
35
41
|
|
|
36
42
|
def subscriber
|
|
37
|
-
@subscriber ||= Rest.new(endpoint_for(SUBSCRIBER), [:get, :post, :put],
|
|
43
|
+
@subscriber ||= Rest.new(endpoint_for(SUBSCRIBER), [:get, :post, :put], credentials)
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
private
|
data/lib/ecal_client/api/rest.rb
CHANGED
|
@@ -6,9 +6,8 @@ module EcalClient
|
|
|
6
6
|
def initialize(endpoint, actions, options = {})
|
|
7
7
|
@endpoint = endpoint
|
|
8
8
|
@actions = actions
|
|
9
|
-
@key = options
|
|
10
|
-
@secret = options
|
|
11
|
-
EcalClient.configuration.options.merge!(options)
|
|
9
|
+
@key = options[:key]
|
|
10
|
+
@secret = options[:secret]
|
|
12
11
|
end
|
|
13
12
|
|
|
14
13
|
def get(options = {})
|
data/lib/ecal_client/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecal_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Faizal Zakaria
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|