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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baed85157042311b88b72862a71b294fb2b04a01
4
- data.tar.gz: 34d419c1e2ecf28ef9ecc8ad746ec23a50a71ba3
3
+ metadata.gz: 8ba2d1121ced6bf4be80e6b4b47580da459e431e
4
+ data.tar.gz: 8c89bce58712f71a0dbda24eea460f2b8bd10c77
5
5
  SHA512:
6
- metadata.gz: 52d2bea0757d983ff4e5e89ca17e4691c525c1f8e0caab4aef0a0a7dc11c1022c7b8a022f682e76ff614dfb3c9c666c6abf2d58acd3474c7b0b3f64193cd8202
7
- data.tar.gz: e4fc49a58d5f8eb31d1d0da16421dfb299d713b9c5ff0e649bfe3d09ab71520a217a83eac329a760382326328bf258d6ff5e6ece00c59a9b685c75b5307c77e6
6
+ metadata.gz: 94a533bc930d99e8f6a0d09a7eda192325f422a976783c50995388c68e38fbe7531286545ecb91e8b30a8e52acb94c3278be4045d2e92271709af4cd786a67e2
7
+ data.tar.gz: 323b58d69e57e99748eb188ab0f0eb1ba9f47de0e182dd1fbed18110fdd9de2a4b1e18ab22d90df7b7680dd3f37d0fe8f6fb585afe384beb1b8406ed2940e06d
@@ -10,31 +10,37 @@ module EcalClient
10
10
  SUBSCRIBER = "/subscriber/".freeze
11
11
 
12
12
  def initialize(options = {})
13
- @options = options
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], @options)
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], @options)
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], @options)
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], @options)
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], @options)
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], @options)
43
+ @subscriber ||= Rest.new(endpoint_for(SUBSCRIBER), [:get, :post, :put], credentials)
38
44
  end
39
45
 
40
46
  private
@@ -6,9 +6,8 @@ module EcalClient
6
6
  def initialize(endpoint, actions, options = {})
7
7
  @endpoint = endpoint
8
8
  @actions = actions
9
- @key = options.delete(:key) || EcalClient.configuration.key
10
- @secret = options.delete(:secret) || EcalClient.configuration.secret
11
- EcalClient.configuration.options.merge!(options)
9
+ @key = options[:key]
10
+ @secret = options[:secret]
12
11
  end
13
12
 
14
13
  def get(options = {})
@@ -1,3 +1,3 @@
1
1
  module EcalClient
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-03 00:00:00.000000000 Z
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler