kerio-api 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f69373b20fb3918fec7293e08e4313713d522494
4
- data.tar.gz: 810d75d6bb149cce9f7309718493288fdf76c040
3
+ metadata.gz: f4d9d024306e053461eb5a659b7303a57d24dbac
4
+ data.tar.gz: 9acc3c5fea08bbb1716dfacfe0b4d13b067c66e2
5
5
  SHA512:
6
- metadata.gz: b9d2ad2390a67da3333e1382b121d726d0ef36fa712ddfc56f6b1e1445258fec0aeaa50acb1946d256073fee1ca3d6625ec27803580dbc8f6ccaec3b4aed0c0d
7
- data.tar.gz: 7cd701832de49f9aa31823239f392a22648d599f4caeb72e70254582289110d259a1f4b00e5b85680d7f3fff8f00f0c47545b9dcfd4d7eacd73cd209c300363d
6
+ metadata.gz: 97f8bb34c364fba26b03511bd5f408debe0f1846d0dd01cecb91b51f0e7ecdd6647ea1d00e2fa8e1fedd18fedeee77d1ce151b6510070ff54b2928ad32a8753f
7
+ data.tar.gz: d4480f608986fa596f95522f33c29ff9555f62466ea7467da839a3f754b7ba3dd012c1d2b032ca4b9a43325ecc18a6c1f6bdc8db0abea8c7816216678b7dc97c
@@ -0,0 +1,21 @@
1
+ module Kerio
2
+ module Api
3
+ module ChainableMethod
4
+ def next_method(params)
5
+ # prefer special implementation over the generic one
6
+ begin
7
+ source = "kerio-api/method/#{params[:names].join('/')}.rb".downcase
8
+ require source
9
+
10
+ method_class = params[:names].inject(Kerio::Api::Method) {|o,c| o.const_get c.capitalize}
11
+ method_instance = method_class.new(params)
12
+
13
+ rescue NameError, LoadError
14
+ method_instance = Kerio::Api::Method::Generic.new(params)
15
+ end
16
+
17
+ return method_instance
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kerio-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Baloun
@@ -87,6 +87,7 @@ extensions: []
87
87
  extra_rdoc_files: []
88
88
  files:
89
89
  - lib/kerio-api.rb
90
+ - lib/kerio-api/chainable_method.rb
90
91
  - lib/kerio-api/client.rb
91
92
  - lib/kerio-api/error.rb
92
93
  - lib/kerio-api/method/generic.rb