icinga2 0.8.1.2 → 0.9.0.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.
- checksums.yaml +4 -4
- data/README.md +16 -7
- data/doc/Array.html +202 -0
- data/doc/Boolean.html +124 -0
- data/doc/FalseClass.html +134 -0
- data/doc/Hash.html +214 -0
- data/doc/Icinga2.html +10 -8
- data/doc/Logging.html +10 -8
- data/doc/Object.html +288 -0
- data/doc/Time.html +202 -0
- data/doc/TrueClass.html +134 -0
- data/doc/_index.html +77 -23
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +75 -58
- data/doc/frames.html +1 -1
- data/doc/index.html +75 -58
- data/doc/method_list.html +126 -54
- data/doc/services.md +34 -16
- data/doc/top-level-namespace.html +9 -5
- data/examples/test.rb +75 -14
- data/lib/icinga2.rb +16 -1
- data/lib/icinga2/network.rb +8 -6
- data/lib/icinga2/services.rb +243 -65
- data/lib/icinga2/version.rb +3 -3
- metadata +10 -3
data/doc/Hash.html
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Hash
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Hash";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (H)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Hash</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Class: Hash
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
|
78
|
+
|
79
|
+
<li class="next">Hash</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/monkey_patches.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>filter hash example: tags = [ 'foo', 'bar', 'fii' ]
|
108
|
+
useableTags = tags.filter( 'fii' )</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<h2>
|
125
|
+
Instance Method Summary
|
126
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
127
|
+
</h2>
|
128
|
+
|
129
|
+
<ul class="summary">
|
130
|
+
|
131
|
+
<li class="public ">
|
132
|
+
<span class="summary_signature">
|
133
|
+
|
134
|
+
<a href="#filter-instance_method" title="#filter (instance method)">#<strong>filter</strong>(*args) ⇒ Object </a>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
|
152
|
+
|
153
|
+
</ul>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<div id="instance_method_details" class="method_details_list">
|
159
|
+
<h2>Instance Method Details</h2>
|
160
|
+
|
161
|
+
|
162
|
+
<div class="method_details first">
|
163
|
+
<h3 class="signature first" id="filter-instance_method">
|
164
|
+
|
165
|
+
#<strong>filter</strong>(*args) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
</h3><table class="source_code">
|
172
|
+
<tr>
|
173
|
+
<td>
|
174
|
+
<pre class="lines">
|
175
|
+
|
176
|
+
|
177
|
+
60
|
178
|
+
61
|
179
|
+
62
|
180
|
+
63
|
181
|
+
64
|
182
|
+
65
|
183
|
+
66
|
184
|
+
67</pre>
|
185
|
+
</td>
|
186
|
+
<td>
|
187
|
+
<pre class="code"><span class="info file"># File 'lib/monkey_patches.rb', line 60</span>
|
188
|
+
|
189
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span> <span class='rparen'>)</span>
|
190
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='rparen'>)</span>
|
191
|
+
<span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span> <span class='const'>Symbol</span> <span class='rparen'>)</span>
|
192
|
+
<span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='rparen'>)</span> <span class='rbrace'>}</span>
|
193
|
+
<span class='kw'>else</span>
|
194
|
+
<span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span> <span class='id identifier rubyid_key'>key</span> <span class='rparen'>)</span> <span class='rbrace'>}</span>
|
195
|
+
<span class='kw'>end</span>
|
196
|
+
<span class='kw'>end</span></pre>
|
197
|
+
</td>
|
198
|
+
</tr>
|
199
|
+
</table>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div id="footer">
|
207
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
208
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
209
|
+
0.9.4 (ruby-2.2.8).
|
210
|
+
</div>
|
211
|
+
|
212
|
+
</div>
|
213
|
+
</body>
|
214
|
+
</html>
|
data/doc/Icinga2.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Icinga2
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</head>
|
29
29
|
<body>
|
30
30
|
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
32
|
<div id="resizer"></div>
|
33
33
|
</div>
|
34
34
|
|
@@ -59,6 +59,8 @@
|
|
59
59
|
<div class="clear"></div>
|
60
60
|
</div>
|
61
61
|
|
62
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
62
64
|
<div id="content"><h1>Module: Icinga2
|
63
65
|
|
64
66
|
|
@@ -78,8 +80,8 @@
|
|
78
80
|
|
79
81
|
<dl>
|
80
82
|
<dt>Defined in:</dt>
|
81
|
-
<dd>lib/icinga2.rb<span class="defines">,<br />
|
82
|
-
lib/icinga2
|
83
|
+
<dd>lib/icinga2/tools.rb<span class="defines">,<br />
|
84
|
+
lib/icinga2.rb,<br /> lib/icinga2/hosts.rb,<br /> lib/icinga2/users.rb,<br /> lib/icinga2/client.rb,<br /> lib/icinga2/version.rb,<br /> lib/icinga2/network.rb,<br /> lib/icinga2/services.rb,<br /> lib/icinga2/converts.rb,<br /> lib/icinga2/downtimes.rb,<br /> lib/icinga2/statistics.rb,<br /> lib/icinga2/usergroups.rb,<br /> lib/icinga2/hostgroups.rb,<br /> lib/icinga2/notifications.rb,<br /> lib/icinga2/servicegroups.rb</span>
|
83
85
|
</dd>
|
84
86
|
</dl>
|
85
87
|
|
@@ -100,7 +102,7 @@
|
|
100
102
|
<p class="children">
|
101
103
|
|
102
104
|
|
103
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span>, <span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span>, <span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span>, <span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span>, <span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span>, <span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span>, <span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span>, <span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span>, <span class='object_link'><a href="Icinga2/Statistics.html" title="Icinga2::Statistics (module)">Statistics</a></span>, <span class='object_link'><a href="Icinga2/Tools.html" title="Icinga2::Tools (module)">Tools</a></span>, <span class='object_link'><a href="Icinga2/Usergroups.html" title="Icinga2::Usergroups (module)">Usergroups</a></span>, <span class='object_link'><a href="Icinga2/Users.html" title="Icinga2::Users (module)">Users</a></span
|
105
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span>, <span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span>, <span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span>, <span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span>, <span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span>, <span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span>, <span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span>, <span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span>, <span class='object_link'><a href="Icinga2/Statistics.html" title="Icinga2::Statistics (module)">Statistics</a></span>, <span class='object_link'><a href="Icinga2/Tools.html" title="Icinga2::Tools (module)">Tools</a></span>, <span class='object_link'><a href="Icinga2/Usergroups.html" title="Icinga2::Usergroups (module)">Usergroups</a></span>, <span class='object_link'><a href="Icinga2/Users.html" title="Icinga2::Users (module)">Users</a></span>
|
104
106
|
|
105
107
|
|
106
108
|
|
@@ -222,7 +224,7 @@
|
|
222
224
|
|
223
225
|
</div>
|
224
226
|
</dt>
|
225
|
-
<dd><pre class="code"><span class='
|
227
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.0.0.pre3</span><span class='tstring_end'>'</span></span></pre></dd>
|
226
228
|
|
227
229
|
</dl>
|
228
230
|
|
@@ -237,9 +239,9 @@
|
|
237
239
|
</div>
|
238
240
|
|
239
241
|
<div id="footer">
|
240
|
-
Generated on
|
242
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
241
243
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
242
|
-
0.9.
|
244
|
+
0.9.4 (ruby-2.2.8).
|
243
245
|
</div>
|
244
246
|
|
245
247
|
</div>
|
data/doc/Logging.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Logging
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</head>
|
29
29
|
<body>
|
30
30
|
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
32
|
<div id="resizer"></div>
|
33
33
|
</div>
|
34
34
|
|
@@ -59,6 +59,8 @@
|
|
59
59
|
<div class="clear"></div>
|
60
60
|
</div>
|
61
61
|
|
62
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
62
64
|
<div id="content"><h1>Module: Logging
|
63
65
|
|
64
66
|
|
@@ -202,7 +204,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
202
204
|
<div class="method_details first">
|
203
205
|
<h3 class="signature first" id="configure_logger_for-class_method">
|
204
206
|
|
205
|
-
.<strong>configure_logger_for</strong>(classname) ⇒ <tt>Object</tt>
|
207
|
+
.<strong>configure_logger_for</strong>(classname) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
206
208
|
|
207
209
|
|
208
210
|
|
@@ -250,7 +252,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
250
252
|
<div class="method_details ">
|
251
253
|
<h3 class="signature " id="logger_for-class_method">
|
252
254
|
|
253
|
-
.<strong>logger_for</strong>(classname) ⇒ <tt>Object</tt>
|
255
|
+
.<strong>logger_for</strong>(classname) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
254
256
|
|
255
257
|
|
256
258
|
|
@@ -286,7 +288,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
286
288
|
<div class="method_details first">
|
287
289
|
<h3 class="signature first" id="logger-instance_method">
|
288
290
|
|
289
|
-
#<strong>logger</strong> ⇒ <tt>Object</tt>
|
291
|
+
#<strong>logger</strong> ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
290
292
|
|
291
293
|
|
292
294
|
|
@@ -306,7 +308,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
306
308
|
<pre class="code"><span class="info file"># File 'lib/logging.rb', line 13</span>
|
307
309
|
|
308
310
|
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
309
|
-
<span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'
|
311
|
+
<span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'>Logging</span><span class='period'>.</span><span class='id identifier rubyid_logger_for'>logger_for</span><span class='lparen'>(</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='rparen'>)</span>
|
310
312
|
<span class='kw'>end</span></pre>
|
311
313
|
</td>
|
312
314
|
</tr>
|
@@ -318,9 +320,9 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
318
320
|
</div>
|
319
321
|
|
320
322
|
<div id="footer">
|
321
|
-
Generated on
|
323
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
322
324
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
323
|
-
0.9.
|
325
|
+
0.9.4 (ruby-2.2.8).
|
324
326
|
</div>
|
325
327
|
|
326
328
|
</div>
|
data/doc/Object.html
ADDED
@@ -0,0 +1,288 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Object
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Object";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (O)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Object</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Class: Object
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
74
|
+
<span class="inheritName">BasicObject</span>
|
75
|
+
|
76
|
+
</dd>
|
77
|
+
</dl>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dl>
|
90
|
+
<dt>Defined in:</dt>
|
91
|
+
<dd>lib/monkey_patches.rb</dd>
|
92
|
+
</dl>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<h2>Overview</h2><div class="docstring">
|
97
|
+
<div class="discussion">
|
98
|
+
|
99
|
+
<p>None of the above solutions work with a multi-level hash They only work on
|
100
|
+
the first level: :level1=>{“level2”=>“baz”} The
|
101
|
+
following two variations solve the problem in the same way transform hash
|
102
|
+
keys to symbols multi_hash = { 'foo' => 'bar',
|
103
|
+
'level1' => { 'level2' => 'baz' } }
|
104
|
+
multi_hash = multi_hash.deep_string_keys</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>
|
121
|
+
Instance Method Summary
|
122
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
123
|
+
</h2>
|
124
|
+
|
125
|
+
<ul class="summary">
|
126
|
+
|
127
|
+
<li class="public ">
|
128
|
+
<span class="summary_signature">
|
129
|
+
|
130
|
+
<a href="#deep_string_keys-instance_method" title="#deep_string_keys (instance method)">#<strong>deep_string_keys</strong> ⇒ Object </a>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</span>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#deep_symbolize_keys-instance_method" title="#deep_symbolize_keys (instance method)">#<strong>deep_symbolize_keys</strong> ⇒ Object </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
167
|
+
|
168
|
+
</li>
|
169
|
+
|
170
|
+
|
171
|
+
</ul>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<div id="instance_method_details" class="method_details_list">
|
177
|
+
<h2>Instance Method Details</h2>
|
178
|
+
|
179
|
+
|
180
|
+
<div class="method_details first">
|
181
|
+
<h3 class="signature first" id="deep_string_keys-instance_method">
|
182
|
+
|
183
|
+
#<strong>deep_string_keys</strong> ⇒ <tt><span class='object_link'><a href="" title="Object (class)">Object</a></span></tt>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
</h3><table class="source_code">
|
190
|
+
<tr>
|
191
|
+
<td>
|
192
|
+
<pre class="lines">
|
193
|
+
|
194
|
+
|
195
|
+
29
|
196
|
+
30
|
197
|
+
31
|
198
|
+
32
|
199
|
+
33
|
200
|
+
34
|
201
|
+
35
|
202
|
+
36
|
203
|
+
37
|
204
|
+
38
|
205
|
+
39
|
206
|
+
40</pre>
|
207
|
+
</td>
|
208
|
+
<td>
|
209
|
+
<pre class="code"><span class="info file"># File 'lib/monkey_patches.rb', line 29</span>
|
210
|
+
|
211
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deep_string_keys'>deep_string_keys</span>
|
212
|
+
|
213
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span> <span class='const'>Hash</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
214
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_memo'>memo</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span><span class='op'>|</span>
|
215
|
+
<span class='id identifier rubyid_memo'>memo</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_deep_string_keys'>deep_string_keys</span> <span class='rbrace'>}</span>
|
216
|
+
<span class='kw'>end</span>
|
217
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span> <span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span> <span class='const'>Array</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
218
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:deep_string_keys</span><span class='rparen'>)</span>
|
219
|
+
<span class='kw'>end</span>
|
220
|
+
|
221
|
+
<span class='kw'>self</span>
|
222
|
+
<span class='kw'>end</span></pre>
|
223
|
+
</td>
|
224
|
+
</tr>
|
225
|
+
</table>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div class="method_details ">
|
229
|
+
<h3 class="signature " id="deep_symbolize_keys-instance_method">
|
230
|
+
|
231
|
+
#<strong>deep_symbolize_keys</strong> ⇒ <tt><span class='object_link'><a href="" title="Object (class)">Object</a></span></tt>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</h3><table class="source_code">
|
238
|
+
<tr>
|
239
|
+
<td>
|
240
|
+
<pre class="lines">
|
241
|
+
|
242
|
+
|
243
|
+
16
|
244
|
+
17
|
245
|
+
18
|
246
|
+
19
|
247
|
+
20
|
248
|
+
21
|
249
|
+
22
|
250
|
+
23
|
251
|
+
24
|
252
|
+
25
|
253
|
+
26
|
254
|
+
27</pre>
|
255
|
+
</td>
|
256
|
+
<td>
|
257
|
+
<pre class="code"><span class="info file"># File 'lib/monkey_patches.rb', line 16</span>
|
258
|
+
|
259
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deep_symbolize_keys'>deep_symbolize_keys</span>
|
260
|
+
|
261
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span> <span class='const'>Hash</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
262
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_memo'>memo</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span><span class='op'>|</span>
|
263
|
+
<span class='id identifier rubyid_memo'>memo</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_m'>m</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_deep_string_keys'>deep_string_keys</span> <span class='rbrace'>}</span>
|
264
|
+
<span class='kw'>end</span>
|
265
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span> <span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span> <span class='const'>Array</span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
266
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:deep_string_keys</span><span class='rparen'>)</span>
|
267
|
+
<span class='kw'>end</span>
|
268
|
+
|
269
|
+
<span class='kw'>self</span>
|
270
|
+
<span class='kw'>end</span></pre>
|
271
|
+
</td>
|
272
|
+
</tr>
|
273
|
+
</table>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div id="footer">
|
281
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
282
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
283
|
+
0.9.4 (ruby-2.2.8).
|
284
|
+
</div>
|
285
|
+
|
286
|
+
</div>
|
287
|
+
</body>
|
288
|
+
</html>
|