greeve 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c74e50f7c6af078c20a7fea2db5db8aa32d1c3ae
4
+ data.tar.gz: 6d323febc65e84b6417819d3e37691218778aed8
5
+ SHA512:
6
+ metadata.gz: 502e933def950237206eed50377ef452d5aeda9a2c1439d52ff8dcaaec40308455d6ef2d80a45199a3d49fe362ed6673cb6751083fe3ef37ffc9ba09bea5df11
7
+ data.tar.gz: cbe5c2dfbed637ff6bcd8c6f1979aa09b31bf8356b62bd9425eb207047909e37565f77c9d38c723130da267c55e9d277e2d1514b412ed1a03e09772a65fb6965
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,4 @@
1
+ # Contributing
2
+
3
+ See [EVEolve/contributing](https://github.com/EVEolve/contributing/blob/master/CONTRIBUTING.md)
4
+ for the guidelines on contributing to this project.
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2016 Alex McLain
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Greeve
2
+
3
+ A Ruby wrapper for the [EVE Online XML API](https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/index.html).
data/doc/Greeve.html ADDED
@@ -0,0 +1,169 @@
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: Greeve
8
+
9
+ &mdash; Documentation by YARD 0.9.5
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 = "Greeve";
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 (G)</a> &raquo;
40
+
41
+
42
+ <span class="title">Greeve</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>Module: Greeve
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dl>
82
+ <dt>Defined in:</dt>
83
+ <dd>lib/greeve.rb<span class="defines">,<br />
84
+ lib/greeve/row.rb,<br /> lib/greeve/rowset.rb,<br /> lib/greeve/version.rb,<br /> lib/greeve/base_item.rb,<br /> lib/greeve/eve/character_info.rb</span>
85
+ </dd>
86
+ </dl>
87
+
88
+ </div>
89
+
90
+ <h2>Overview</h2><div class="docstring">
91
+ <div class="discussion">
92
+
93
+ <p>A Ruby wrapper for the EVE Online XML API.</p>
94
+
95
+
96
+ </div>
97
+ </div>
98
+ <div class="tags">
99
+
100
+
101
+ </div><h2>Defined Under Namespace</h2>
102
+ <p class="children">
103
+
104
+
105
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Greeve/API.html" title="Greeve::API (module)">API</a></span>, <span class='object_link'><a href="Greeve/Character.html" title="Greeve::Character (module)">Character</a></span>, <span class='object_link'><a href="Greeve/Corporation.html" title="Greeve::Corporation (module)">Corporation</a></span>, <span class='object_link'><a href="Greeve/Eve.html" title="Greeve::Eve (module)">Eve</a></span>, <span class='object_link'><a href="Greeve/Map.html" title="Greeve::Map (module)">Map</a></span>, <span class='object_link'><a href="Greeve/Server.html" title="Greeve::Server (module)">Server</a></span>
106
+
107
+
108
+
109
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Greeve/BaseItem.html" title="Greeve::BaseItem (class)">BaseItem</a></span>, <span class='object_link'><a href="Greeve/Row.html" title="Greeve::Row (class)">Row</a></span>, <span class='object_link'><a href="Greeve/Rowset.html" title="Greeve::Rowset (class)">Rowset</a></span>
110
+
111
+
112
+ </p>
113
+
114
+ <h2>Constant Summary</h2>
115
+ <dl class="constants">
116
+
117
+ <dt id="EVE_API_BASE_URL-constant" class="">EVE_API_BASE_URL =
118
+ <div class="docstring">
119
+ <div class="discussion">
120
+
121
+ <p>Base URL of the EVE XML API.</p>
122
+
123
+
124
+ </div>
125
+ </div>
126
+ <div class="tags">
127
+
128
+
129
+ </div>
130
+ </dt>
131
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://api.eveonline.com</span><span class='tstring_end'>&quot;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
132
+
133
+ <dt id="VERSION-constant" class="">VERSION =
134
+ <div class="docstring">
135
+ <div class="discussion">
136
+
137
+ <p>Current version of Greeve.</p>
138
+
139
+
140
+ </div>
141
+ </div>
142
+ <div class="tags">
143
+
144
+
145
+ </div>
146
+ </dt>
147
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.0.1</span><span class='tstring_end'>&quot;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
148
+
149
+ </dl>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+ </div>
160
+
161
+ <div id="footer">
162
+ Generated on Wed Aug 24 18:52:46 2016 by
163
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
164
+ 0.9.5 (ruby-2.1.7).
165
+ </div>
166
+
167
+ </div>
168
+ </body>
169
+ </html>
@@ -0,0 +1,118 @@
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: Greeve::API
8
+
9
+ &mdash; Documentation by YARD 0.9.5
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 = "Greeve::API";
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 (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Greeve.html" title="Greeve (module)">Greeve</a></span></span>
41
+ &raquo;
42
+ <span class="title">API</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>Module: Greeve::API
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dl>
82
+ <dt>Defined in:</dt>
83
+ <dd>lib/greeve.rb</dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>API resources.</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div>
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ </div>
109
+
110
+ <div id="footer">
111
+ Generated on Wed Aug 24 18:52:46 2016 by
112
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
113
+ 0.9.5 (ruby-2.1.7).
114
+ </div>
115
+
116
+ </div>
117
+ </body>
118
+ </html>
@@ -0,0 +1,621 @@
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: Greeve::API::BaseItem
8
+
9
+ &mdash; Documentation by YARD 0.9.5
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 = "Greeve::API::BaseItem";
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 (B)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Greeve.html" title="Greeve (module)">Greeve</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../API.html" title="Greeve::API (module)">API</a></span></span>
41
+ &raquo;
42
+ <span class="title">BaseItem</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: Greeve::API::BaseItem
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+ <dl>
72
+ <dt>Inherits:</dt>
73
+ <dd>
74
+ <span class="inheritName">Object</span>
75
+
76
+ <ul class="fullTree">
77
+ <li>Object</li>
78
+
79
+ <li class="next">Greeve::API::BaseItem</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/greeve/api/base_item.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>An abstract class used to map XML responses from the EVE XML API into Ruby
108
+ objects. This class is designed to be subclassed by classes representing
109
+ the specific EVE API resources.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div><div id="subclasses">
118
+ <h2>Direct Known Subclasses</h2>
119
+ <p class="children"><span class='object_link'><a href="CharacterInfo.html" title="Greeve::API::CharacterInfo (class)">CharacterInfo</a></span></p>
120
+ </div>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <h2>
130
+ Class Method Summary
131
+ <small><a href="#" class="summary_toggle">collapse</a></small>
132
+ </h2>
133
+
134
+ <ul class="summary">
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#attribute-class_method" title="attribute (class method)">.<strong>attribute</strong>(name, opts = {}) &#x21d2; Object </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+ <span class="summary_desc"><div class='inline'>
154
+ <p>Map an XML attribute to a Ruby object.</p>
155
+ </div></span>
156
+
157
+ </li>
158
+
159
+
160
+ </ul>
161
+
162
+ <h2>
163
+ Instance Method Summary
164
+ <small><a href="#" class="summary_toggle">collapse</a></small>
165
+ </h2>
166
+
167
+ <ul class="summary">
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(xml_element) &#x21d2; BaseItem </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+ <span class="note title constructor">constructor</span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ <p>A new instance of BaseItem.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> &#x21d2; Object </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>:nodoc:.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; Object </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+ <span class="summary_desc"><div class='inline'>
237
+ <p>:nodoc:.</p>
238
+ </div></span>
239
+
240
+ </li>
241
+
242
+
243
+ </ul>
244
+
245
+
246
+ <div id="constructor_details" class="method_details_list">
247
+ <h2>Constructor Details</h2>
248
+
249
+ <div class="method_details first">
250
+ <h3 class="signature first" id="initialize-instance_method">
251
+
252
+ #<strong>initialize</strong>(xml_element) &#x21d2; <tt><span class='object_link'><a href="" title="Greeve::API::BaseItem (class)">BaseItem</a></span></tt>
253
+
254
+
255
+
256
+
257
+
258
+ </h3><div class="docstring">
259
+ <div class="discussion">
260
+
261
+ <p>Returns a new instance of BaseItem</p>
262
+
263
+
264
+ </div>
265
+ </div>
266
+ <div class="tags">
267
+ <p class="tag_title">Parameters:</p>
268
+ <ul class="param">
269
+
270
+ <li>
271
+
272
+ <span class='name'>xml_element</span>
273
+
274
+
275
+ <span class='type'>(<tt>Ox::Element</tt>)</span>
276
+
277
+
278
+
279
+ &mdash;
280
+ <div class='inline'>
281
+ <p>the root XML element for this item</p>
282
+ </div>
283
+
284
+ </li>
285
+
286
+ </ul>
287
+
288
+ <p class="tag_title">Raises:</p>
289
+ <ul class="raise">
290
+
291
+ <li>
292
+
293
+
294
+ <span class='type'>(<tt>TypeError</tt>)</span>
295
+
296
+
297
+
298
+ </li>
299
+
300
+ </ul>
301
+
302
+ </div><table class="source_code">
303
+ <tr>
304
+ <td>
305
+ <pre class="lines">
306
+
307
+
308
+ 47
309
+ 48
310
+ 49
311
+ 50
312
+ 51
313
+ 52</pre>
314
+ </td>
315
+ <td>
316
+ <pre class="code"><span class="info file"># File 'lib/greeve/api/base_item.rb', line 47</span>
317
+
318
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_xml_element'>xml_element</span><span class='rparen'>)</span>
319
+ <span class='ivar'>@xml_element</span> <span class='op'>=</span> <span class='id identifier rubyid_xml_element'>xml_element</span>
320
+
321
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>TypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Cannot instantiate an abstract class</span><span class='tstring_end'>&quot;</span></span> \
322
+ <span class='kw'>if</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_superclass'>superclass</span> <span class='op'>!=</span> <span class='const'>Greeve</span><span class='op'>::</span><span class='const'>API</span><span class='op'>::</span><span class='const'>BaseItem</span>
323
+ <span class='kw'>end</span></pre>
324
+ </td>
325
+ </tr>
326
+ </table>
327
+ </div>
328
+
329
+ </div>
330
+
331
+
332
+ <div id="class_method_details" class="method_details_list">
333
+ <h2>Class Method Details</h2>
334
+
335
+
336
+ <div class="method_details first">
337
+ <h3 class="signature first" id="attribute-class_method">
338
+
339
+ .<strong>attribute</strong>(name, opts = {}) &#x21d2; <tt>Object</tt>
340
+
341
+
342
+
343
+
344
+
345
+ </h3><div class="docstring">
346
+ <div class="discussion">
347
+
348
+ <p>Map an XML attribute to a Ruby object.</p>
349
+
350
+
351
+ </div>
352
+ </div>
353
+ <div class="tags">
354
+ <p class="tag_title">Parameters:</p>
355
+ <ul class="param">
356
+
357
+ <li>
358
+
359
+ <span class='name'>name</span>
360
+
361
+
362
+ <span class='type'>(<tt>Symbol</tt>)</span>
363
+
364
+
365
+
366
+ &mdash;
367
+ <div class='inline'>
368
+ <p>the Ruby name for this attribute</p>
369
+ </div>
370
+
371
+ </li>
372
+
373
+ <li>
374
+
375
+ <span class='name'>xpath</span>
376
+
377
+
378
+ <span class='type'>(<tt>Hash</tt>)</span>
379
+
380
+
381
+
382
+ &mdash;
383
+ <div class='inline'>
384
+ <p>a customizable set of options</p>
385
+ </div>
386
+
387
+ </li>
388
+
389
+ <li>
390
+
391
+ <span class='name'>type</span>
392
+
393
+
394
+ <span class='type'>(<tt>Hash</tt>)</span>
395
+
396
+
397
+
398
+ &mdash;
399
+ <div class='inline'>
400
+ <p>a customizable set of options</p>
401
+ </div>
402
+
403
+ </li>
404
+
405
+ </ul>
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+ <p class="tag_title">Returns:</p>
414
+ <ul class="return">
415
+
416
+ <li>
417
+
418
+
419
+ <span class='type'></span>
420
+
421
+
422
+
423
+
424
+ <div class='inline'>
425
+ <p>the value located at the xpath</p>
426
+ </div>
427
+
428
+ </li>
429
+
430
+ </ul>
431
+
432
+ </div><table class="source_code">
433
+ <tr>
434
+ <td>
435
+ <pre class="lines">
436
+
437
+
438
+ 18
439
+ 19
440
+ 20
441
+ 21
442
+ 22
443
+ 23
444
+ 24
445
+ 25
446
+ 26
447
+ 27
448
+ 28
449
+ 29
450
+ 30
451
+ 31
452
+ 32
453
+ 33
454
+ 34
455
+ 35
456
+ 36
457
+ 37
458
+ 38
459
+ 39
460
+ 40
461
+ 41
462
+ 42
463
+ 43
464
+ 44</pre>
465
+ </td>
466
+ <td>
467
+ <pre class="code"><span class="info file"># File 'lib/greeve/api/base_item.rb', line 18</span>
468
+
469
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attribute'>attribute</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
470
+ <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
471
+ <span class='ivar'>@attributes</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
472
+
473
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Attribute `</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>` defined more than once</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='ivar'>@attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
474
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>`:xpath` not specified for `</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>`</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:xpath</span><span class='rbracket'>]</span>
475
+
476
+ <span class='ivar'>@attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span>
477
+ <span class='label'>xpath:</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:xpath</span><span class='rbracket'>]</span><span class='comma'>,</span>
478
+ <span class='label'>type:</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='comma'>,</span>
479
+ <span class='rbrace'>}</span>
480
+
481
+ <span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>do</span>
482
+ <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='ivar'>@xml_element</span><span class='period'>.</span><span class='id identifier rubyid_locate'>locate</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:xpath</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
483
+
484
+ <span class='kw'>case</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span>
485
+ <span class='kw'>when</span> <span class='symbol'>:integer</span>
486
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
487
+ <span class='kw'>when</span> <span class='symbol'>:numeric</span>
488
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span>
489
+ <span class='kw'>when</span> <span class='symbol'>:string</span>
490
+ <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
491
+ <span class='kw'>else</span>
492
+ <span class='id identifier rubyid_value'>value</span>
493
+ <span class='kw'>end</span>
494
+ <span class='kw'>end</span>
495
+ <span class='kw'>end</span></pre>
496
+ </td>
497
+ </tr>
498
+ </table>
499
+ </div>
500
+
501
+ </div>
502
+
503
+ <div id="instance_method_details" class="method_details_list">
504
+ <h2>Instance Method Details</h2>
505
+
506
+
507
+ <div class="method_details first">
508
+ <h3 class="signature first" id="inspect-instance_method">
509
+
510
+ #<strong>inspect</strong> &#x21d2; <tt>Object</tt>
511
+
512
+
513
+
514
+
515
+
516
+ </h3><div class="docstring">
517
+ <div class="discussion">
518
+
519
+ <p>:nodoc:</p>
520
+
521
+
522
+ </div>
523
+ </div>
524
+ <div class="tags">
525
+
526
+
527
+ </div><table class="source_code">
528
+ <tr>
529
+ <td>
530
+ <pre class="lines">
531
+
532
+
533
+ 55
534
+ 56
535
+ 57
536
+ 58
537
+ 59
538
+ 60
539
+ 61
540
+ 62
541
+ 63
542
+ 64</pre>
543
+ </td>
544
+ <td>
545
+ <pre class="code"><span class="info file"># File 'lib/greeve/api/base_item.rb', line 55</span>
546
+
547
+ <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
548
+ <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_to_s'>to_s</span>
549
+
550
+ <span class='kw'>unless</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
551
+ <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_l'>l</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
552
+ <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attrs'>attrs</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
553
+ <span class='kw'>end</span>
554
+
555
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>#&lt;</span><span class='embexpr_beg'>#{</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='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_object_id'>object_id</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attrs'>attrs</span><span class='embexpr_end'>}</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span>
556
+ <span class='kw'>end</span></pre>
557
+ </td>
558
+ </tr>
559
+ </table>
560
+ </div>
561
+
562
+ <div class="method_details ">
563
+ <h3 class="signature " id="to_s-instance_method">
564
+
565
+ #<strong>to_s</strong> &#x21d2; <tt>Object</tt>
566
+
567
+
568
+
569
+
570
+
571
+ </h3><div class="docstring">
572
+ <div class="discussion">
573
+
574
+ <p>:nodoc:</p>
575
+
576
+
577
+ </div>
578
+ </div>
579
+ <div class="tags">
580
+
581
+
582
+ </div><table class="source_code">
583
+ <tr>
584
+ <td>
585
+ <pre class="lines">
586
+
587
+
588
+ 67
589
+ 68
590
+ 69
591
+ 70
592
+ 71
593
+ 72</pre>
594
+ </td>
595
+ <td>
596
+ <pre class="code"><span class="info file"># File 'lib/greeve/api/base_item.rb', line 67</span>
597
+
598
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
599
+ <span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span>
600
+ <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_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='symbol'>:@attributes</span><span class='rparen'>)</span><span class='period'>
601
+ </span><span class='id identifier rubyid_ .map'> .map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid___send__'>__send__</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span><span class='period'>
602
+ </span><span class='id identifier rubyid_ .join'> .join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
603
+ <span class='kw'>end</span></pre>
604
+ </td>
605
+ </tr>
606
+ </table>
607
+ </div>
608
+
609
+ </div>
610
+
611
+ </div>
612
+
613
+ <div id="footer">
614
+ Generated on Mon Aug 15 13:13:06 2016 by
615
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
616
+ 0.9.5 (ruby-2.1.7).
617
+ </div>
618
+
619
+ </div>
620
+ </body>
621
+ </html>