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 +4 -4
- data/lib/kerio-api/chainable_method.rb +21 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d9d024306e053461eb5a659b7303a57d24dbac
|
4
|
+
data.tar.gz: 9acc3c5fea08bbb1716dfacfe0b4d13b067c66e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|