icinga2 0.9.2.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -9
- data/doc/downtimes.md +39 -0
- data/lib/icinga2/actions.rb +152 -0
- data/lib/icinga2/client.rb +29 -22
- data/lib/icinga2/configuration_management.rb +312 -0
- data/lib/icinga2/downtimes.rb +72 -4
- data/lib/icinga2/hostgroups.rb +6 -6
- data/lib/icinga2/hosts.rb +23 -23
- data/lib/icinga2/network.rb +115 -10
- data/lib/icinga2/notifications.rb +17 -9
- data/lib/icinga2/servicegroups.rb +5 -5
- data/lib/icinga2/services.rb +32 -30
- data/lib/icinga2/statistics.rb +17 -14
- data/lib/icinga2/tools.rb +31 -10
- data/lib/icinga2/usergroups.rb +5 -5
- data/lib/icinga2/users.rb +5 -5
- data/lib/icinga2/validator.rb +40 -34
- data/lib/icinga2/version.rb +1 -3
- data/lib/monkey_patches.rb +67 -14
- data/spec/icinga2_spec.rb +1013 -0
- data/spec/spec_helper.rb +13 -0
- metadata +9 -22
- data/doc/Array.html +0 -200
- data/doc/Boolean.html +0 -122
- data/doc/FalseClass.html +0 -132
- data/doc/Hash.html +0 -332
- data/doc/Icinga2.html +0 -247
- data/doc/Logging.html +0 -328
- data/doc/Object.html +0 -286
- data/doc/Time.html +0 -200
- data/doc/TrueClass.html +0 -132
- data/doc/_index.html +0 -352
- data/doc/class_list.html +0 -51
- data/doc/examples +0 -122
- data/doc/file.README.html +0 -349
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -17
- data/doc/index.html +0 -349
- data/doc/method_list.html +0 -755
- data/doc/top-level-namespace.html +0 -112
data/doc/Logging.html
DELETED
@@ -1,328 +0,0 @@
|
|
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
|
-
Module: Logging
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.11
|
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 = "Logging";
|
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?1"></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 (L)</a> »
|
40
|
-
|
41
|
-
|
42
|
-
<span class="title">Logging</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
|
-
<div id="content"><h1>Module: Logging
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
<dl>
|
78
|
-
<dt>Included in:</dt>
|
79
|
-
<dd><span class='object_link'><a href="Icinga2/Client.html" title="Icinga2::Client (class)">Icinga2::Client</a></span></dd>
|
80
|
-
</dl>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
<dl>
|
85
|
-
<dt>Defined in:</dt>
|
86
|
-
<dd>lib/logging.rb</dd>
|
87
|
-
</dl>
|
88
|
-
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<h2>Overview</h2><div class="docstring">
|
92
|
-
<div class="discussion">
|
93
|
-
|
94
|
-
<p>taken from <a
|
95
|
-
href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-among-module-classes">stackoverflow.com/questions/917566/ruby-share-logger-instance-among-module-classes</a></p>
|
96
|
-
|
97
|
-
|
98
|
-
</div>
|
99
|
-
</div>
|
100
|
-
<div class="tags">
|
101
|
-
|
102
|
-
|
103
|
-
</div>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<h2>
|
112
|
-
Class Method Summary
|
113
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
114
|
-
</h2>
|
115
|
-
|
116
|
-
<ul class="summary">
|
117
|
-
|
118
|
-
<li class="public ">
|
119
|
-
<span class="summary_signature">
|
120
|
-
|
121
|
-
<a href="#configure_logger_for-class_method" title="configure_logger_for (class method)">.<strong>configure_logger_for</strong>(classname) ⇒ Object </a>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
</span>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
136
|
-
|
137
|
-
</li>
|
138
|
-
|
139
|
-
|
140
|
-
<li class="public ">
|
141
|
-
<span class="summary_signature">
|
142
|
-
|
143
|
-
<a href="#logger_for-class_method" title="logger_for (class method)">.<strong>logger_for</strong>(classname) ⇒ Object </a>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
</span>
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
158
|
-
|
159
|
-
</li>
|
160
|
-
|
161
|
-
|
162
|
-
</ul>
|
163
|
-
|
164
|
-
<h2>
|
165
|
-
Instance Method Summary
|
166
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
167
|
-
</h2>
|
168
|
-
|
169
|
-
<ul class="summary">
|
170
|
-
|
171
|
-
<li class="public ">
|
172
|
-
<span class="summary_signature">
|
173
|
-
|
174
|
-
<a href="#logger-instance_method" title="#logger (instance method)">#<strong>logger</strong> ⇒ Object </a>
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
</span>
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
189
|
-
|
190
|
-
</li>
|
191
|
-
|
192
|
-
|
193
|
-
</ul>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
<div id="class_method_details" class="method_details_list">
|
199
|
-
<h2>Class Method Details</h2>
|
200
|
-
|
201
|
-
|
202
|
-
<div class="method_details first">
|
203
|
-
<h3 class="signature first" id="configure_logger_for-class_method">
|
204
|
-
|
205
|
-
.<strong>configure_logger_for</strong>(classname) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
</h3><table class="source_code">
|
212
|
-
<tr>
|
213
|
-
<td>
|
214
|
-
<pre class="lines">
|
215
|
-
|
216
|
-
|
217
|
-
28
|
218
|
-
29
|
219
|
-
30
|
220
|
-
31
|
221
|
-
32
|
222
|
-
33
|
223
|
-
34
|
224
|
-
35
|
225
|
-
36
|
226
|
-
37
|
227
|
-
38
|
228
|
-
39</pre>
|
229
|
-
</td>
|
230
|
-
<td>
|
231
|
-
<pre class="code"><span class="info file"># File 'lib/logging.rb', line 28</span>
|
232
|
-
|
233
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_configure_logger_for'>configure_logger_for</span><span class='lparen'>(</span> <span class='id identifier rubyid_classname'>classname</span> <span class='rparen'>)</span>
|
234
|
-
|
235
|
-
<span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>STDOUT</span><span class='rparen'>)</span>
|
236
|
-
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_progname'>progname</span> <span class='op'>=</span> <span class='id identifier rubyid_classname'>classname</span>
|
237
|
-
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>UNKNOWN</span>
|
238
|
-
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_datetime_format'>datetime_format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%Y-%m-%d %H:%M:%S::%3N</span><span class='tstring_end'>'</span></span>
|
239
|
-
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_formatter'>formatter</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_severity'>severity</span><span class='comma'>,</span> <span class='id identifier rubyid_datetime'>datetime</span><span class='comma'>,</span> <span class='id identifier rubyid_progname'>progname</span><span class='comma'>,</span> <span class='id identifier rubyid_msg'>msg</span><span class='op'>|</span>
|
240
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_datetime'>datetime</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span> <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_datetime_format'>datetime_format</span> <span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_severity'>severity</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> : </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_progname'>progname</span><span class='embexpr_end'>}</span><span class='tstring_content'> - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_msg'>msg</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
241
|
-
<span class='kw'>end</span>
|
242
|
-
|
243
|
-
<span class='id identifier rubyid_logger'>logger</span>
|
244
|
-
<span class='kw'>end</span></pre>
|
245
|
-
</td>
|
246
|
-
</tr>
|
247
|
-
</table>
|
248
|
-
</div>
|
249
|
-
|
250
|
-
<div class="method_details ">
|
251
|
-
<h3 class="signature " id="logger_for-class_method">
|
252
|
-
|
253
|
-
.<strong>logger_for</strong>(classname) ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
</h3><table class="source_code">
|
260
|
-
<tr>
|
261
|
-
<td>
|
262
|
-
<pre class="lines">
|
263
|
-
|
264
|
-
|
265
|
-
24
|
266
|
-
25
|
267
|
-
26</pre>
|
268
|
-
</td>
|
269
|
-
<td>
|
270
|
-
<pre class="code"><span class="info file"># File 'lib/logging.rb', line 24</span>
|
271
|
-
|
272
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_logger_for'>logger_for</span><span class='lparen'>(</span> <span class='id identifier rubyid_classname'>classname</span> <span class='rparen'>)</span>
|
273
|
-
<span class='ivar'>@loggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_classname'>classname</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_configure_logger_for'>configure_logger_for</span><span class='lparen'>(</span> <span class='id identifier rubyid_classname'>classname</span> <span class='rparen'>)</span>
|
274
|
-
<span class='kw'>end</span></pre>
|
275
|
-
</td>
|
276
|
-
</tr>
|
277
|
-
</table>
|
278
|
-
</div>
|
279
|
-
|
280
|
-
</div>
|
281
|
-
|
282
|
-
<div id="instance_method_details" class="method_details_list">
|
283
|
-
<h2>Instance Method Details</h2>
|
284
|
-
|
285
|
-
|
286
|
-
<div class="method_details first">
|
287
|
-
<h3 class="signature first" id="logger-instance_method">
|
288
|
-
|
289
|
-
#<strong>logger</strong> ⇒ <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt>
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
</h3><table class="source_code">
|
296
|
-
<tr>
|
297
|
-
<td>
|
298
|
-
<pre class="lines">
|
299
|
-
|
300
|
-
|
301
|
-
13
|
302
|
-
14
|
303
|
-
15</pre>
|
304
|
-
</td>
|
305
|
-
<td>
|
306
|
-
<pre class="code"><span class="info file"># File 'lib/logging.rb', line 13</span>
|
307
|
-
|
308
|
-
<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'><span class='object_link'><a href="" title="Logging (module)">Logging</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger_for'><span class='object_link'><a href="#logger_for-class_method" title="Logging.logger_for (method)">logger_for</a></span></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
|
-
<span class='kw'>end</span></pre>
|
311
|
-
</td>
|
312
|
-
</tr>
|
313
|
-
</table>
|
314
|
-
</div>
|
315
|
-
|
316
|
-
</div>
|
317
|
-
|
318
|
-
</div>
|
319
|
-
|
320
|
-
<div id="footer">
|
321
|
-
Generated on Sat Dec 9 20:28:06 2017 by
|
322
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
323
|
-
0.9.11 (ruby-2.2.8).
|
324
|
-
</div>
|
325
|
-
|
326
|
-
</div>
|
327
|
-
</body>
|
328
|
-
</html>
|
data/doc/Object.html
DELETED
@@ -1,286 +0,0 @@
|
|
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.11
|
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?1"></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
|
-
<div id="content"><h1>Class: Object
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">BasicObject</span>
|
73
|
-
|
74
|
-
</dd>
|
75
|
-
</dl>
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
<dl>
|
88
|
-
<dt>Defined in:</dt>
|
89
|
-
<dd>lib/monkey_patches.rb</dd>
|
90
|
-
</dl>
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
<h2>Overview</h2><div class="docstring">
|
95
|
-
<div class="discussion">
|
96
|
-
|
97
|
-
<p>None of the above solutions work with a multi-level hash They only work on
|
98
|
-
the first level: :level1=>{“level2”=>“baz”} The
|
99
|
-
following two variations solve the problem in the same way transform hash
|
100
|
-
keys to symbols multi_hash = { 'foo' => 'bar',
|
101
|
-
'level1' => { 'level2' => 'baz' } }
|
102
|
-
multi_hash = multi_hash.deep_string_keys</p>
|
103
|
-
|
104
|
-
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
<div class="tags">
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<h2>
|
119
|
-
Instance Method Summary
|
120
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
121
|
-
</h2>
|
122
|
-
|
123
|
-
<ul class="summary">
|
124
|
-
|
125
|
-
<li class="public ">
|
126
|
-
<span class="summary_signature">
|
127
|
-
|
128
|
-
<a href="#deep_string_keys-instance_method" title="#deep_string_keys (instance method)">#<strong>deep_string_keys</strong> ⇒ Object </a>
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
</span>
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
143
|
-
|
144
|
-
</li>
|
145
|
-
|
146
|
-
|
147
|
-
<li class="public ">
|
148
|
-
<span class="summary_signature">
|
149
|
-
|
150
|
-
<a href="#deep_symbolize_keys-instance_method" title="#deep_symbolize_keys (instance method)">#<strong>deep_symbolize_keys</strong> ⇒ Object </a>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
</span>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
165
|
-
|
166
|
-
</li>
|
167
|
-
|
168
|
-
|
169
|
-
</ul>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<div id="instance_method_details" class="method_details_list">
|
175
|
-
<h2>Instance Method Details</h2>
|
176
|
-
|
177
|
-
|
178
|
-
<div class="method_details first">
|
179
|
-
<h3 class="signature first" id="deep_string_keys-instance_method">
|
180
|
-
|
181
|
-
#<strong>deep_string_keys</strong> ⇒ <tt><span class='object_link'><a href="" title="Object (class)">Object</a></span></tt>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
</h3><table class="source_code">
|
188
|
-
<tr>
|
189
|
-
<td>
|
190
|
-
<pre class="lines">
|
191
|
-
|
192
|
-
|
193
|
-
29
|
194
|
-
30
|
195
|
-
31
|
196
|
-
32
|
197
|
-
33
|
198
|
-
34
|
199
|
-
35
|
200
|
-
36
|
201
|
-
37
|
202
|
-
38
|
203
|
-
39
|
204
|
-
40</pre>
|
205
|
-
</td>
|
206
|
-
<td>
|
207
|
-
<pre class="code"><span class="info file"># File 'lib/monkey_patches.rb', line 29</span>
|
208
|
-
|
209
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_deep_string_keys'>deep_string_keys</span>
|
210
|
-
|
211
|
-
<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'><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
212
|
-
<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>
|
213
|
-
<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>
|
214
|
-
<span class='kw'>end</span>
|
215
|
-
<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'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
216
|
-
<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>
|
217
|
-
<span class='kw'>end</span>
|
218
|
-
|
219
|
-
<span class='kw'>self</span>
|
220
|
-
<span class='kw'>end</span></pre>
|
221
|
-
</td>
|
222
|
-
</tr>
|
223
|
-
</table>
|
224
|
-
</div>
|
225
|
-
|
226
|
-
<div class="method_details ">
|
227
|
-
<h3 class="signature " id="deep_symbolize_keys-instance_method">
|
228
|
-
|
229
|
-
#<strong>deep_symbolize_keys</strong> ⇒ <tt><span class='object_link'><a href="" title="Object (class)">Object</a></span></tt>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</h3><table class="source_code">
|
236
|
-
<tr>
|
237
|
-
<td>
|
238
|
-
<pre class="lines">
|
239
|
-
|
240
|
-
|
241
|
-
16
|
242
|
-
17
|
243
|
-
18
|
244
|
-
19
|
245
|
-
20
|
246
|
-
21
|
247
|
-
22
|
248
|
-
23
|
249
|
-
24
|
250
|
-
25
|
251
|
-
26
|
252
|
-
27</pre>
|
253
|
-
</td>
|
254
|
-
<td>
|
255
|
-
<pre class="code"><span class="info file"># File 'lib/monkey_patches.rb', line 16</span>
|
256
|
-
|
257
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_deep_symbolize_keys'>deep_symbolize_keys</span>
|
258
|
-
|
259
|
-
<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'><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span></span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
260
|
-
<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>
|
261
|
-
<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>
|
262
|
-
<span class='kw'>end</span>
|
263
|
-
<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'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></span> <span class='rparen'>)</span> <span class='rparen'>)</span>
|
264
|
-
<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>
|
265
|
-
<span class='kw'>end</span>
|
266
|
-
|
267
|
-
<span class='kw'>self</span>
|
268
|
-
<span class='kw'>end</span></pre>
|
269
|
-
</td>
|
270
|
-
</tr>
|
271
|
-
</table>
|
272
|
-
</div>
|
273
|
-
|
274
|
-
</div>
|
275
|
-
|
276
|
-
</div>
|
277
|
-
|
278
|
-
<div id="footer">
|
279
|
-
Generated on Sat Dec 9 20:28:07 2017 by
|
280
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
281
|
-
0.9.11 (ruby-2.2.8).
|
282
|
-
</div>
|
283
|
-
|
284
|
-
</div>
|
285
|
-
</body>
|
286
|
-
</html>
|