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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4aeecb629d8241c35b30415d08d448a148954d8
4
- data.tar.gz: be24be7676e60b5a81b2dd46ed0f111d9b9c9ff0
3
+ metadata.gz: 98e061336da61cde9ec724f506387ff91968312f
4
+ data.tar.gz: 2e1d52825ff37bcf5687f50f816b9006089cef24
5
5
  SHA512:
6
- metadata.gz: ddfc59494f904d33467c77fe32515e8e331a2cd99f7440f026a111dc7a8d91982924722cc14c123877bc74854a835e1d5eb3b1ce8c7cc51f272b9448337b57cb
7
- data.tar.gz: dca7daaddf53edf7d51061fa7484e18acd957b7bdd9ac42157bd946473f391c4d35607f4ad8a8151ee78e4e49313f341de91164bc8507b19ce69adda19e4c60d
6
+ metadata.gz: 28303aee59b5658c34c2119af8db0c6b2732a6fe7db3a768fa2fbf8dfafa8bd50e329b8c7552a938099d59bfa65d0f69c343fc5fc419717c5634f686c9e0ad1a
7
+ data.tar.gz: e970fbc3fb889e368e395b90b30f408c733bfdde3307dae29c303c8b5bc5b258de55979d5c120d3d7a63750a8cb181522b509e170b9a6a295c453eb749b01541
data/README.md CHANGED
@@ -22,6 +22,10 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
+ Method call is a thin wrapper of the JSON-RPC.
26
+
27
+ JSON is created dynamically, it is checked on the server side.
28
+
25
29
  ```ruby
26
30
  require 'zabbix/client'
27
31
 
@@ -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 = "#{@prefix}.#{method_name}"
27
- params = args[0] || []
28
- options = args[1] || {}
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.each do |arg|
104
- unless arg.kind_of?(Hash) or arg.kind_of?(Array)
105
- raise TypeError, "wrong argument: #{arg.inspect} (expected Hash or Array)"
106
- end
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
@@ -1,5 +1,5 @@
1
1
  module Zabbix
2
2
  class Client
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara