dyndyndong 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dyndyndong/services/generic.rb +19 -14
- data/lib/dyndyndong/version.rb +1 -1
- data/lib/dyndyndong.rb +1 -1
- metadata +3 -3
@@ -70,44 +70,49 @@ class Generic < Service
|
|
70
70
|
when 'msgtable'
|
71
71
|
raise ArgumentError, "wrong number of arguments (#{args.size} for 1)" if args.size != 1
|
72
72
|
raise ArgumentError, "wrong type" if !args.first.is_a?(Hash)
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
|
74
|
+
self.class_eval {
|
75
|
+
define_method 'MSGTABLE' do |x|
|
76
|
+
args.first[x]
|
76
77
|
end
|
77
78
|
}
|
78
79
|
when 'update_host'
|
79
80
|
raise ArgumentError, "wrong number of arguments (#{args.size} for 1)" if args.size != 1
|
80
81
|
raise ArgumentError, "wrong type" if !args.first.is_a?(String)
|
81
|
-
|
82
|
-
|
83
|
-
|
82
|
+
|
83
|
+
self.class_eval {
|
84
|
+
define_method 'update_host' do
|
85
|
+
args.first
|
84
86
|
end
|
85
87
|
}
|
86
88
|
when 'offline'
|
87
89
|
raise ArgumentError, "wrong number of arguments (#{args.size} for 2)" if args.size != 2
|
88
90
|
raise ArgumentError, "wrong type" if !args[0].is_a?(String) or !args[1].is_a?(String)
|
89
|
-
|
90
|
-
|
91
|
+
|
92
|
+
self.class_eval {
|
93
|
+
define_method 'offlines' do
|
91
94
|
{
|
92
|
-
'YES' =>
|
93
|
-
'NO' =>
|
94
|
-
}
|
95
|
+
'YES' => args[0],
|
96
|
+
'NO' => args[1]
|
97
|
+
}
|
95
98
|
end
|
96
99
|
}
|
100
|
+
else
|
101
|
+
raise ArgumentError, "Cannot set #{sym}"
|
97
102
|
end
|
98
103
|
end
|
99
104
|
|
100
105
|
private
|
101
106
|
|
102
|
-
def offlines
|
107
|
+
def offlines
|
103
108
|
{
|
104
109
|
'YES' => 'YES',
|
105
110
|
'NO' => 'NO'
|
106
|
-
}
|
111
|
+
}
|
107
112
|
end
|
108
113
|
|
109
114
|
def offline?(offline)
|
110
|
-
offline ? offlines
|
115
|
+
offline ? offlines['YES'] : offlines['NO']
|
111
116
|
end
|
112
117
|
|
113
118
|
def getip(h = nil)
|
data/lib/dyndyndong/version.rb
CHANGED
data/lib/dyndyndong.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- shura
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-12-16 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|