zbx 0.1.0 → 0.1.1
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.
- data/README.md +7 -0
- data/lib/zbx/api.rb +0 -3
- data/lib/zbx/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -37,6 +37,13 @@ ZBX::API.new username, password, api_url do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
ZBX::API.new(username, password, api_url).host.get hostids: 10160
|
40
|
+
|
41
|
+
ZBX::API.new do
|
42
|
+
api_url! api_url
|
43
|
+
username! user
|
44
|
+
password! password
|
45
|
+
host.get hostids: 10160
|
46
|
+
end
|
40
47
|
```
|
41
48
|
|
42
49
|
## Contributing
|
data/lib/zbx/api.rb
CHANGED
@@ -23,17 +23,14 @@ module ZBX
|
|
23
23
|
def username! username
|
24
24
|
@user, @auth = username, nil
|
25
25
|
end
|
26
|
-
alias_method :username=, :username!
|
27
26
|
|
28
27
|
def password! password
|
29
28
|
@pass, @auth = password, nil
|
30
29
|
end
|
31
|
-
alias_method :password=, :password!
|
32
30
|
|
33
31
|
def api_url! api_url
|
34
32
|
@api_url, @auth = api_url, nil
|
35
33
|
end
|
36
|
-
alias_method :api_url=, :api_url!
|
37
34
|
|
38
35
|
def request method, params={}
|
39
36
|
# in any api request except `user.login`
|
data/lib/zbx/version.rb
CHANGED