zabbix-client 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/zabbix/client/client.rb +12 -7
- data/lib/zabbix/client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98e061336da61cde9ec724f506387ff91968312f
|
4
|
+
data.tar.gz: 2e1d52825ff37bcf5687f50f816b9006089cef24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28303aee59b5658c34c2119af8db0c6b2732a6fe7db3a768fa2fbf8dfafa8bd50e329b8c7552a938099d59bfa65d0f69c343fc5fc419717c5634f686c9e0ad1a
|
7
|
+
data.tar.gz: e970fbc3fb889e368e395b90b30f408c733bfdde3307dae29c303c8b5bc5b258de55979d5c120d3d7a63750a8cb181522b509e170b9a6a295c453eb749b01541
|
data/README.md
CHANGED
data/lib/zabbix/client/client.rb
CHANGED
@@ -23,9 +23,10 @@ class Zabbix::Client
|
|
23
23
|
def method_missing(method_name, *args, &block)
|
24
24
|
validate_args(args)
|
25
25
|
|
26
|
-
method
|
27
|
-
params
|
28
|
-
options
|
26
|
+
method = "#{@prefix}.#{method_name}"
|
27
|
+
params = args[0] || []
|
28
|
+
options = args[1] || {}
|
29
|
+
|
29
30
|
response = query(method, params, options)
|
30
31
|
|
31
32
|
if (error = response['error'])
|
@@ -100,10 +101,14 @@ class Zabbix::Client
|
|
100
101
|
raise ArgumentError, "wrong number of arguments: #{args.inspect} (#{args.length} for 0..2)"
|
101
102
|
end
|
102
103
|
|
103
|
-
args.
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
params, options = args.values_at(0, 1)
|
105
|
+
|
106
|
+
unless params.nil? or params.kind_of?(Hash) or params.kind_of?(Array)
|
107
|
+
raise TypeError, "wrong argument: #{params.inspect} (expected Hash or Array)"
|
108
|
+
end
|
109
|
+
|
110
|
+
unless options.nil? or options.kind_of?(Hash)
|
111
|
+
raise TypeError, "wrong argument: #{options.inspect} (expected Hash)"
|
107
112
|
end
|
108
113
|
end
|
109
114
|
end # Method
|