greeve 0.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 +7 -0
- data/CONTRIBUTING.md +4 -0
- data/LICENSE +8 -0
- data/README.md +3 -0
- data/doc/Greeve.html +169 -0
- data/doc/Greeve/API.html +118 -0
- data/doc/Greeve/API/BaseItem.html +621 -0
- data/doc/Greeve/API/CharacterInfo.html +156 -0
- data/doc/Greeve/BaseItem.html +1416 -0
- data/doc/Greeve/Character.html +118 -0
- data/doc/Greeve/Corporation.html +118 -0
- data/doc/Greeve/Eve.html +130 -0
- data/doc/Greeve/Eve/CharacterInfo.html +251 -0
- data/doc/Greeve/Map.html +118 -0
- data/doc/Greeve/Request.html +225 -0
- data/doc/Greeve/Row.html +583 -0
- data/doc/Greeve/Rowset.html +613 -0
- data/doc/Greeve/Server.html +118 -0
- data/doc/_index.html +244 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +481 -0
- data/doc/file.CONTRIBUTING.html +76 -0
- data/doc/file.LICENSE.html +92 -0
- data/doc/file.README.html +75 -0
- data/doc/file_list.html +66 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +75 -0
- data/doc/js/app.js +243 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +211 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/greeve.rb +29 -0
- data/lib/greeve/base_item.rb +237 -0
- data/lib/greeve/eve/character_info.rb +45 -0
- data/lib/greeve/row.rb +72 -0
- data/lib/greeve/rowset.rb +71 -0
- data/lib/greeve/version.rb +4 -0
- metadata +215 -0
@@ -0,0 +1,156 @@
|
|
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::CharacterInfo
|
8
|
+
|
9
|
+
— 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::CharacterInfo";
|
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 (C)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Greeve.html" title="Greeve (module)">Greeve</a></span></span> » <span class='title'><span class='object_link'><a href="../API.html" title="Greeve::API (module)">API</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">CharacterInfo</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::CharacterInfo
|
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="BaseItem.html" title="Greeve::API::BaseItem (class)">BaseItem</a></span></span>
|
75
|
+
|
76
|
+
<ul class="fullTree">
|
77
|
+
<li>Object</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="BaseItem.html" title="Greeve::API::BaseItem (class)">BaseItem</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">Greeve::API::CharacterInfo</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/greeve/api/character_info.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>Public character info.</p>
|
110
|
+
|
111
|
+
<p>Endpoint: <a
|
112
|
+
href="https://api.eveonline.com/eve/CharacterInfo.xml.aspx?characterID=character_id">apicharacter_id">api.eveonlinecharacter_id">api.eveonline.com/eve/CharacterInfocharacter_id">api.eveonline.com/eve/CharacterInfo.xmlcharacter_id">api.eveonline.com/eve/CharacterInfo.xml.aspx?characterID={character_id</a></p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<h2>Method Summary</h2>
|
135
|
+
|
136
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="BaseItem.html" title="Greeve::API::BaseItem (class)">BaseItem</a></span></h3>
|
137
|
+
<p class="inherited"><span class='object_link'><a href="BaseItem.html#attribute-class_method" title="Greeve::API::BaseItem.attribute (method)">attribute</a></span>, <span class='object_link'><a href="BaseItem.html#initialize-instance_method" title="Greeve::API::BaseItem#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="BaseItem.html#inspect-instance_method" title="Greeve::API::BaseItem#inspect (method)">#inspect</a></span>, <span class='object_link'><a href="BaseItem.html#to_s-instance_method" title="Greeve::API::BaseItem#to_s (method)">#to_s</a></span></p>
|
138
|
+
<div id="constructor_details" class="method_details_list">
|
139
|
+
<h2>Constructor Details</h2>
|
140
|
+
|
141
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="BaseItem.html#initialize-instance_method" title="Greeve::API::BaseItem#initialize (method)">Greeve::API::BaseItem</a></span></p>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div id="footer">
|
149
|
+
Generated on Mon Aug 15 13:13:06 2016 by
|
150
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
151
|
+
0.9.5 (ruby-2.1.7).
|
152
|
+
</div>
|
153
|
+
|
154
|
+
</div>
|
155
|
+
</body>
|
156
|
+
</html>
|
@@ -0,0 +1,1416 @@
|
|
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::BaseItem
|
8
|
+
|
9
|
+
— 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::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> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Greeve.html" title="Greeve (module)">Greeve</a></span></span>
|
41
|
+
»
|
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::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::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/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="Eve/CharacterInfo.html" title="Greeve::Eve::CharacterInfo (class)">Eve::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 = {}) ⇒ 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>A DSL method to map an XML attribute to a Ruby object.</p>
|
155
|
+
</div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#endpoint-class_method" title="endpoint (class method)">.<strong>endpoint</strong>(path) ⇒ Object </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<span class="summary_desc"><div class='inline'>
|
178
|
+
<p>A DSL method to specify the API endpoint.</p>
|
179
|
+
</div></span>
|
180
|
+
|
181
|
+
</li>
|
182
|
+
|
183
|
+
|
184
|
+
<li class="public ">
|
185
|
+
<span class="summary_signature">
|
186
|
+
|
187
|
+
<a href="#rowset-class_method" title="rowset (class method)">.<strong>rowset</strong>(name, opts = {}, &block) ⇒ Object </a>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<span class="summary_desc"><div class='inline'>
|
202
|
+
<p>A DSL method to map an XML rowset to a Ruby object.</p>
|
203
|
+
</div></span>
|
204
|
+
|
205
|
+
</li>
|
206
|
+
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
<h2>
|
211
|
+
Instance Method Summary
|
212
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
213
|
+
</h2>
|
214
|
+
|
215
|
+
<ul class="summary">
|
216
|
+
|
217
|
+
<li class="public ">
|
218
|
+
<span class="summary_signature">
|
219
|
+
|
220
|
+
<a href="#cache_expired%3F-instance_method" title="#cache_expired? (instance method)">#<strong>cache_expired?</strong> ⇒ Boolean </a>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
235
|
+
<p>True if the API cache timer has expired and this object can be refreshed.</p>
|
236
|
+
</div></span>
|
237
|
+
|
238
|
+
</li>
|
239
|
+
|
240
|
+
|
241
|
+
<li class="public ">
|
242
|
+
<span class="summary_signature">
|
243
|
+
|
244
|
+
<a href="#cached_until-instance_method" title="#cached_until (instance method)">#<strong>cached_until</strong> ⇒ Time<sup>?</sup> </a>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</span>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
<span class="summary_desc"><div class='inline'>
|
259
|
+
<p>Time when the cache expires and the resource can be refreshed (sends an
|
260
|
+
HTTP request).</p>
|
261
|
+
</div></span>
|
262
|
+
|
263
|
+
</li>
|
264
|
+
|
265
|
+
|
266
|
+
<li class="public ">
|
267
|
+
<span class="summary_signature">
|
268
|
+
|
269
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(opts = {}) ⇒ BaseItem </a>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
<span class="note title constructor">constructor</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<span class="abstract note title">abstract</span>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
<span class="summary_desc"><div class='inline'>
|
286
|
+
<p>A new instance of BaseItem.</p>
|
287
|
+
</div></span>
|
288
|
+
|
289
|
+
</li>
|
290
|
+
|
291
|
+
|
292
|
+
<li class="public ">
|
293
|
+
<span class="summary_signature">
|
294
|
+
|
295
|
+
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒ Object </a>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</span>
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<span class="summary_desc"><div class='inline'>
|
310
|
+
<p>:nodoc:.</p>
|
311
|
+
</div></span>
|
312
|
+
|
313
|
+
</li>
|
314
|
+
|
315
|
+
|
316
|
+
<li class="public ">
|
317
|
+
<span class="summary_signature">
|
318
|
+
|
319
|
+
<a href="#refresh-instance_method" title="#refresh (instance method)">#<strong>refresh</strong> ⇒ Object </a>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
</span>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
<span class="summary_desc"><div class='inline'>
|
334
|
+
<p>Query the API, refreshing this object's data.</p>
|
335
|
+
</div></span>
|
336
|
+
|
337
|
+
</li>
|
338
|
+
|
339
|
+
|
340
|
+
<li class="public ">
|
341
|
+
<span class="summary_signature">
|
342
|
+
|
343
|
+
<a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> ⇒ Hash </a>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
</span>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
<span class="summary_desc"><div class='inline'>
|
358
|
+
<p>A hash of non-nil attributes.</p>
|
359
|
+
</div></span>
|
360
|
+
|
361
|
+
</li>
|
362
|
+
|
363
|
+
|
364
|
+
<li class="public ">
|
365
|
+
<span class="summary_signature">
|
366
|
+
|
367
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> ⇒ String </a>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
</span>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
<span class="summary_desc"><div class='inline'>
|
382
|
+
<p>A string representation of the non-nil attributes.</p>
|
383
|
+
</div></span>
|
384
|
+
|
385
|
+
</li>
|
386
|
+
|
387
|
+
|
388
|
+
</ul>
|
389
|
+
|
390
|
+
|
391
|
+
<div id="constructor_details" class="method_details_list">
|
392
|
+
<h2>Constructor Details</h2>
|
393
|
+
|
394
|
+
<div class="method_details first">
|
395
|
+
<h3 class="signature first" id="initialize-instance_method">
|
396
|
+
|
397
|
+
#<strong>initialize</strong>(opts = {}) ⇒ <tt><span class='object_link'><a href="" title="Greeve::BaseItem (class)">BaseItem</a></span></tt>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
</h3><div class="docstring">
|
404
|
+
<div class="discussion">
|
405
|
+
<div class="note abstract">
|
406
|
+
<strong>This method is abstract.</strong>
|
407
|
+
<div class='inline'>
|
408
|
+
<p>Subclass and use the DSL methods to map API endpoints to objects</p>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
<p>Returns a new instance of BaseItem</p>
|
413
|
+
|
414
|
+
|
415
|
+
</div>
|
416
|
+
</div>
|
417
|
+
<div class="tags">
|
418
|
+
|
419
|
+
<div class="examples">
|
420
|
+
<p class="tag_title">Examples:</p>
|
421
|
+
|
422
|
+
|
423
|
+
<pre class="example code"><code><span class='kw'>super</span><span class='lparen'>(</span><span class='label'>query_params:</span> <span class='lbrace'>{</span>
|
424
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>characterID</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_character_id'>character_id</span><span class='comma'>,</span>
|
425
|
+
<span class='rbrace'>}</span><span class='rparen'>)</span></code></pre>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
<p class="tag_title">Parameters:</p>
|
429
|
+
<ul class="param">
|
430
|
+
|
431
|
+
<li>
|
432
|
+
|
433
|
+
<span class='name'>opts</span>
|
434
|
+
|
435
|
+
|
436
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
437
|
+
|
438
|
+
|
439
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
440
|
+
|
441
|
+
|
442
|
+
—
|
443
|
+
<div class='inline'>
|
444
|
+
<p>a customizable set of options</p>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
</li>
|
448
|
+
|
449
|
+
</ul>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
455
|
+
<ul class="option">
|
456
|
+
|
457
|
+
<li>
|
458
|
+
<span class="name">:key</span>
|
459
|
+
<span class="type">(<tt>String</tt>, <tt>Fixnum</tt>)</span>
|
460
|
+
<span class="default">
|
461
|
+
|
462
|
+
</span>
|
463
|
+
|
464
|
+
— <div class='inline'>
|
465
|
+
<p>API key</p>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</li>
|
469
|
+
|
470
|
+
<li>
|
471
|
+
<span class="name">:vcode</span>
|
472
|
+
<span class="type">(<tt>String</tt>)</span>
|
473
|
+
<span class="default">
|
474
|
+
|
475
|
+
</span>
|
476
|
+
|
477
|
+
— <div class='inline'>
|
478
|
+
<p>API vCode</p>
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</li>
|
482
|
+
|
483
|
+
<li>
|
484
|
+
<span class="name">:query_params</span>
|
485
|
+
<span class="type">(<tt>Hash<String, String></tt>)</span>
|
486
|
+
<span class="default">
|
487
|
+
|
488
|
+
</span>
|
489
|
+
|
490
|
+
— <div class='inline'>
|
491
|
+
<p>a hash of HTTP query params that specify how a value maps to the API
|
492
|
+
request</p>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
</li>
|
496
|
+
|
497
|
+
</ul>
|
498
|
+
|
499
|
+
|
500
|
+
<p class="tag_title">Raises:</p>
|
501
|
+
<ul class="raise">
|
502
|
+
|
503
|
+
<li>
|
504
|
+
|
505
|
+
|
506
|
+
<span class='type'>(<tt>TypeError</tt>)</span>
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
</li>
|
511
|
+
|
512
|
+
</ul>
|
513
|
+
|
514
|
+
</div><table class="source_code">
|
515
|
+
<tr>
|
516
|
+
<td>
|
517
|
+
<pre class="lines">
|
518
|
+
|
519
|
+
|
520
|
+
127
|
521
|
+
128
|
522
|
+
129
|
523
|
+
130
|
524
|
+
131
|
525
|
+
132
|
526
|
+
133
|
527
|
+
134
|
528
|
+
135
|
529
|
+
136
|
530
|
+
137
|
531
|
+
138
|
532
|
+
139
|
533
|
+
140
|
534
|
+
141
|
535
|
+
142
|
536
|
+
143</pre>
|
537
|
+
</td>
|
538
|
+
<td>
|
539
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 127</span>
|
540
|
+
|
541
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</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>
|
542
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>TypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Cannot instantiate an abstract class</span><span class='tstring_end'>"</span></span> \
|
543
|
+
<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'>BaseItem</span>
|
544
|
+
|
545
|
+
<span class='ivar'>@api_key</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span>
|
546
|
+
<span class='ivar'>@api_vcode</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:vcode</span><span class='rbracket'>]</span>
|
547
|
+
<span class='ivar'>@query_params</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:query_params</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
548
|
+
|
549
|
+
<span class='kw'>if</span> <span class='ivar'>@api_key</span> <span class='op'>&&</span> <span class='ivar'>@api_vcode</span>
|
550
|
+
<span class='ivar'>@query_params</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='lbrace'>{</span>
|
551
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>keyID</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='ivar'>@api_key</span><span class='comma'>,</span>
|
552
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>vCode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='ivar'>@api_vcode</span><span class='comma'>,</span>
|
553
|
+
<span class='rbrace'>}</span><span class='rparen'>)</span>
|
554
|
+
<span class='kw'>end</span>
|
555
|
+
|
556
|
+
<span class='id identifier rubyid_refresh'>refresh</span>
|
557
|
+
<span class='kw'>end</span></pre>
|
558
|
+
</td>
|
559
|
+
</tr>
|
560
|
+
</table>
|
561
|
+
</div>
|
562
|
+
|
563
|
+
</div>
|
564
|
+
|
565
|
+
|
566
|
+
<div id="class_method_details" class="method_details_list">
|
567
|
+
<h2>Class Method Details</h2>
|
568
|
+
|
569
|
+
|
570
|
+
<div class="method_details first">
|
571
|
+
<h3 class="signature first" id="attribute-class_method">
|
572
|
+
|
573
|
+
.<strong>attribute</strong>(name, opts = {}) ⇒ <tt>Object</tt>
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
</h3><div class="docstring">
|
580
|
+
<div class="discussion">
|
581
|
+
|
582
|
+
<p>A DSL method to map an XML attribute to a Ruby object.</p>
|
583
|
+
|
584
|
+
|
585
|
+
</div>
|
586
|
+
</div>
|
587
|
+
<div class="tags">
|
588
|
+
|
589
|
+
<div class="examples">
|
590
|
+
<p class="tag_title">Examples:</p>
|
591
|
+
|
592
|
+
|
593
|
+
<pre class="example code"><code><span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:character_id</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>characterID/?[0]</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:integer</span></code></pre>
|
594
|
+
|
595
|
+
</div>
|
596
|
+
<p class="tag_title">Parameters:</p>
|
597
|
+
<ul class="param">
|
598
|
+
|
599
|
+
<li>
|
600
|
+
|
601
|
+
<span class='name'>name</span>
|
602
|
+
|
603
|
+
|
604
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
—
|
609
|
+
<div class='inline'>
|
610
|
+
<p>the Ruby name for this attribute</p>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
</li>
|
614
|
+
|
615
|
+
<li>
|
616
|
+
|
617
|
+
<span class='name'>opts</span>
|
618
|
+
|
619
|
+
|
620
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
621
|
+
|
622
|
+
|
623
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
624
|
+
|
625
|
+
|
626
|
+
—
|
627
|
+
<div class='inline'>
|
628
|
+
<p>a customizable set of options</p>
|
629
|
+
</div>
|
630
|
+
|
631
|
+
</li>
|
632
|
+
|
633
|
+
</ul>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
641
|
+
<ul class="option">
|
642
|
+
|
643
|
+
<li>
|
644
|
+
<span class="name">:xpath</span>
|
645
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
646
|
+
<span class="default">
|
647
|
+
|
648
|
+
</span>
|
649
|
+
|
650
|
+
— <div class='inline'>
|
651
|
+
<p>the xpath string used to locate the attribute in the XML element</p>
|
652
|
+
</div>
|
653
|
+
|
654
|
+
</li>
|
655
|
+
|
656
|
+
<li>
|
657
|
+
<span class="name">:type</span>
|
658
|
+
<span class="type">(<tt>:integer</tt>, <tt>:numeric</tt>, <tt>:string</tt>)</span>
|
659
|
+
<span class="default">
|
660
|
+
|
661
|
+
</span>
|
662
|
+
|
663
|
+
— <div class='inline'>
|
664
|
+
<p>method used to coerce the XML value</p>
|
665
|
+
</div>
|
666
|
+
|
667
|
+
</li>
|
668
|
+
|
669
|
+
</ul>
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
</div><table class="source_code">
|
674
|
+
<tr>
|
675
|
+
<td>
|
676
|
+
<pre class="lines">
|
677
|
+
|
678
|
+
|
679
|
+
22
|
680
|
+
23
|
681
|
+
24
|
682
|
+
25
|
683
|
+
26
|
684
|
+
27
|
685
|
+
28
|
686
|
+
29
|
687
|
+
30
|
688
|
+
31
|
689
|
+
32
|
690
|
+
33
|
691
|
+
34
|
692
|
+
35
|
693
|
+
36
|
694
|
+
37
|
695
|
+
38
|
696
|
+
39
|
697
|
+
40
|
698
|
+
41
|
699
|
+
42
|
700
|
+
43
|
701
|
+
44
|
702
|
+
45
|
703
|
+
46
|
704
|
+
47
|
705
|
+
48
|
706
|
+
49
|
707
|
+
50
|
708
|
+
51
|
709
|
+
52
|
710
|
+
53
|
711
|
+
54
|
712
|
+
55
|
713
|
+
56</pre>
|
714
|
+
</td>
|
715
|
+
<td>
|
716
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 22</span>
|
717
|
+
|
718
|
+
<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>
|
719
|
+
<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>
|
720
|
+
<span class='ivar'>@attributes</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
721
|
+
|
722
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</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>
|
723
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</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>
|
724
|
+
|
725
|
+
<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>
|
726
|
+
<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>
|
727
|
+
<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>
|
728
|
+
<span class='rbrace'>}</span>
|
729
|
+
|
730
|
+
<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>
|
731
|
+
<span class='id identifier rubyid_ivar'>ivar</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='symbol'>:@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
732
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_ivar'>ivar</span> <span class='kw'>unless</span> <span class='id identifier rubyid_ivar'>ivar</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
733
|
+
|
734
|
+
<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>
|
735
|
+
|
736
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
737
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span>
|
738
|
+
<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>
|
739
|
+
<span class='kw'>when</span> <span class='symbol'>:integer</span>
|
740
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
741
|
+
<span class='kw'>when</span> <span class='symbol'>:numeric</span>
|
742
|
+
<span class='const'>BigDecimal</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
743
|
+
<span class='kw'>when</span> <span class='symbol'>:string</span>
|
744
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
745
|
+
<span class='kw'>when</span> <span class='symbol'>:datetime</span>
|
746
|
+
<span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> UTC</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
747
|
+
<span class='kw'>end</span>
|
748
|
+
<span class='kw'>end</span>
|
749
|
+
|
750
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='symbol'>:@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
751
|
+
<span class='kw'>end</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
<div class="method_details ">
|
759
|
+
<h3 class="signature " id="endpoint-class_method">
|
760
|
+
|
761
|
+
.<strong>endpoint</strong>(path) ⇒ <tt>Object</tt>
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
</h3><div class="docstring">
|
768
|
+
<div class="discussion">
|
769
|
+
|
770
|
+
<p>A DSL method to specify the API endpoint.</p>
|
771
|
+
|
772
|
+
|
773
|
+
</div>
|
774
|
+
</div>
|
775
|
+
<div class="tags">
|
776
|
+
|
777
|
+
<div class="examples">
|
778
|
+
<p class="tag_title">Examples:</p>
|
779
|
+
|
780
|
+
|
781
|
+
<pre class="example code"><code><span class='id identifier rubyid_endpoint'>endpoint</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>eve/CharacterInfo</span><span class='tstring_end'>"</span></span></code></pre>
|
782
|
+
|
783
|
+
</div>
|
784
|
+
<p class="tag_title">Parameters:</p>
|
785
|
+
<ul class="param">
|
786
|
+
|
787
|
+
<li>
|
788
|
+
|
789
|
+
<span class='name'>path</span>
|
790
|
+
|
791
|
+
|
792
|
+
<span class='type'>(<tt>String</tt>)</span>
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
—
|
797
|
+
<div class='inline'>
|
798
|
+
<p>path of the API endpoint. Doesn't need to include the leading slash
|
799
|
+
`/`, or the extension `.xml.aspx`</p>
|
800
|
+
</div>
|
801
|
+
|
802
|
+
</li>
|
803
|
+
|
804
|
+
</ul>
|
805
|
+
|
806
|
+
|
807
|
+
</div><table class="source_code">
|
808
|
+
<tr>
|
809
|
+
<td>
|
810
|
+
<pre class="lines">
|
811
|
+
|
812
|
+
|
813
|
+
111
|
814
|
+
112
|
815
|
+
113
|
816
|
+
114</pre>
|
817
|
+
</td>
|
818
|
+
<td>
|
819
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 111</span>
|
820
|
+
|
821
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_endpoint'>endpoint</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
822
|
+
<span class='comment'># Remove leading slash and file extension.
|
823
|
+
</span> <span class='ivar'>@endpoint</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\A\/*(.*?)(?:\.xml)?(?:\.aspx)?\z</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>\1</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
824
|
+
<span class='kw'>end</span></pre>
|
825
|
+
</td>
|
826
|
+
</tr>
|
827
|
+
</table>
|
828
|
+
</div>
|
829
|
+
|
830
|
+
<div class="method_details ">
|
831
|
+
<h3 class="signature " id="rowset-class_method">
|
832
|
+
|
833
|
+
.<strong>rowset</strong>(name, opts = {}, &block) ⇒ <tt>Object</tt>
|
834
|
+
|
835
|
+
|
836
|
+
|
837
|
+
|
838
|
+
|
839
|
+
</h3><div class="docstring">
|
840
|
+
<div class="discussion">
|
841
|
+
|
842
|
+
<p>A DSL method to map an XML rowset to a Ruby object.</p>
|
843
|
+
|
844
|
+
|
845
|
+
</div>
|
846
|
+
</div>
|
847
|
+
<div class="tags">
|
848
|
+
|
849
|
+
<div class="examples">
|
850
|
+
<p class="tag_title">Examples:</p>
|
851
|
+
|
852
|
+
|
853
|
+
<pre class="example code"><code><span class='id identifier rubyid_rowset'>rowset</span> <span class='symbol'>:employment_history</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>eveapi/result/rowset[@name='employmentHistory']</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
854
|
+
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:record_id</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@recordID</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:integer</span>
|
855
|
+
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:corporation_id</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@corporationID</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:integer</span>
|
856
|
+
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:corporation_name</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@corporationName</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:string</span>
|
857
|
+
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:start_date</span><span class='comma'>,</span> <span class='label'>xpath:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@startDate</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>type:</span> <span class='symbol'>:datetime</span>
|
858
|
+
<span class='kw'>end</span></code></pre>
|
859
|
+
|
860
|
+
</div>
|
861
|
+
<p class="tag_title">Parameters:</p>
|
862
|
+
<ul class="param">
|
863
|
+
|
864
|
+
<li>
|
865
|
+
|
866
|
+
<span class='name'>name</span>
|
867
|
+
|
868
|
+
|
869
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
—
|
874
|
+
<div class='inline'>
|
875
|
+
<p>the Ruby name for this attribute</p>
|
876
|
+
</div>
|
877
|
+
|
878
|
+
</li>
|
879
|
+
|
880
|
+
<li>
|
881
|
+
|
882
|
+
<span class='name'>opts</span>
|
883
|
+
|
884
|
+
|
885
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
886
|
+
|
887
|
+
|
888
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
889
|
+
|
890
|
+
|
891
|
+
—
|
892
|
+
<div class='inline'>
|
893
|
+
<p>a customizable set of options</p>
|
894
|
+
</div>
|
895
|
+
|
896
|
+
</li>
|
897
|
+
|
898
|
+
</ul>
|
899
|
+
|
900
|
+
|
901
|
+
|
902
|
+
|
903
|
+
|
904
|
+
|
905
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
906
|
+
<ul class="option">
|
907
|
+
|
908
|
+
<li>
|
909
|
+
<span class="name">:xpath</span>
|
910
|
+
<span class="type">(<tt>Symbol</tt>)</span>
|
911
|
+
<span class="default">
|
912
|
+
|
913
|
+
</span>
|
914
|
+
|
915
|
+
— <div class='inline'>
|
916
|
+
<p>the xpath string used to locate the attribute in the XML element</p>
|
917
|
+
</div>
|
918
|
+
|
919
|
+
</li>
|
920
|
+
|
921
|
+
</ul>
|
922
|
+
|
923
|
+
|
924
|
+
|
925
|
+
|
926
|
+
|
927
|
+
</div><table class="source_code">
|
928
|
+
<tr>
|
929
|
+
<td>
|
930
|
+
<pre class="lines">
|
931
|
+
|
932
|
+
|
933
|
+
72
|
934
|
+
73
|
935
|
+
74
|
936
|
+
75
|
937
|
+
76
|
938
|
+
77
|
939
|
+
78
|
940
|
+
79
|
941
|
+
80
|
942
|
+
81
|
943
|
+
82
|
944
|
+
83
|
945
|
+
84
|
946
|
+
85
|
947
|
+
86
|
948
|
+
87
|
949
|
+
88
|
950
|
+
89
|
951
|
+
90
|
952
|
+
91
|
953
|
+
92
|
954
|
+
93
|
955
|
+
94
|
956
|
+
95
|
957
|
+
96
|
958
|
+
97
|
959
|
+
98
|
960
|
+
99
|
961
|
+
100
|
962
|
+
101
|
963
|
+
102</pre>
|
964
|
+
</td>
|
965
|
+
<td>
|
966
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 72</span>
|
967
|
+
|
968
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rowset'>rowset</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='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
969
|
+
<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>
|
970
|
+
<span class='ivar'>@attributes</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
971
|
+
|
972
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</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>
|
973
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</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>
|
974
|
+
|
975
|
+
<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>
|
976
|
+
<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>
|
977
|
+
<span class='label'>type:</span> <span class='symbol'>:rowset</span><span class='comma'>,</span>
|
978
|
+
<span class='rbrace'>}</span>
|
979
|
+
|
980
|
+
<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>
|
981
|
+
<span class='id identifier rubyid_ivar'>ivar</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='symbol'>:@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
982
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_ivar'>ivar</span> <span class='kw'>unless</span> <span class='id identifier rubyid_ivar'>ivar</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
983
|
+
|
984
|
+
<span class='comment'># Since Ox doesn't support the xpath [@k='v'] syntax, parse it out
|
985
|
+
</span> <span class='comment'># with a regex (captures :path, :attr, :attr_value).
|
986
|
+
</span> <span class='id identifier rubyid_attr_regex'>attr_regex</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>\A(?<path>.*?)\[@(?<attr>\w+)=['"](?<attr_value>\w+)['"]\]\z</span><span class='regexp_end'>}</span></span>
|
987
|
+
<span class='id identifier rubyid_match'>match</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:xpath</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_attr_regex'>attr_regex</span><span class='rparen'>)</span>
|
988
|
+
|
989
|
+
<span class='id identifier rubyid_rowset_element'>rowset_element</span> <span class='op'>=</span>
|
990
|
+
<span class='ivar'>@xml_element</span><span class='period'>
|
991
|
+
</span><span class='id identifier rubyid_ .locate'> .locate</span><span class='lparen'>(</span><span class='id identifier rubyid_match'>match</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>
|
992
|
+
</span><span class='id identifier rubyid_ .find'> .find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_match'>match</span><span class='lbracket'>[</span><span class='symbol'>:attr</span><span class='rbracket'>]</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_match'>match</span><span class='lbracket'>[</span><span class='symbol'>:attr_value</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
993
|
+
|
994
|
+
<span class='id identifier rubyid_rowset'>rowset</span> <span class='op'>=</span> <span class='const'>Rowset</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_rowset_element'>rowset_element</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
995
|
+
|
996
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='symbol'>:@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_rowset'>rowset</span><span class='rparen'>)</span>
|
997
|
+
<span class='kw'>end</span>
|
998
|
+
<span class='kw'>end</span></pre>
|
999
|
+
</td>
|
1000
|
+
</tr>
|
1001
|
+
</table>
|
1002
|
+
</div>
|
1003
|
+
|
1004
|
+
</div>
|
1005
|
+
|
1006
|
+
<div id="instance_method_details" class="method_details_list">
|
1007
|
+
<h2>Instance Method Details</h2>
|
1008
|
+
|
1009
|
+
|
1010
|
+
<div class="method_details first">
|
1011
|
+
<h3 class="signature first" id="cache_expired?-instance_method">
|
1012
|
+
|
1013
|
+
#<strong>cache_expired?</strong> ⇒ <tt>Boolean</tt>
|
1014
|
+
|
1015
|
+
|
1016
|
+
|
1017
|
+
|
1018
|
+
|
1019
|
+
</h3><div class="docstring">
|
1020
|
+
<div class="discussion">
|
1021
|
+
|
1022
|
+
<p>Returns true if the API cache timer has expired and this object can be
|
1023
|
+
refreshed</p>
|
1024
|
+
|
1025
|
+
|
1026
|
+
</div>
|
1027
|
+
</div>
|
1028
|
+
<div class="tags">
|
1029
|
+
|
1030
|
+
<p class="tag_title">Returns:</p>
|
1031
|
+
<ul class="return">
|
1032
|
+
|
1033
|
+
<li>
|
1034
|
+
|
1035
|
+
|
1036
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1037
|
+
|
1038
|
+
|
1039
|
+
|
1040
|
+
—
|
1041
|
+
<div class='inline'>
|
1042
|
+
<p>true if the API cache timer has expired and this object can be refreshed</p>
|
1043
|
+
</div>
|
1044
|
+
|
1045
|
+
</li>
|
1046
|
+
|
1047
|
+
</ul>
|
1048
|
+
|
1049
|
+
</div><table class="source_code">
|
1050
|
+
<tr>
|
1051
|
+
<td>
|
1052
|
+
<pre class="lines">
|
1053
|
+
|
1054
|
+
|
1055
|
+
158
|
1056
|
+
159
|
1057
|
+
160</pre>
|
1058
|
+
</td>
|
1059
|
+
<td>
|
1060
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 158</span>
|
1061
|
+
|
1062
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cache_expired?'>cache_expired?</span>
|
1063
|
+
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_cached_until'>cached_until</span> <span class='op'>&&</span> <span class='id identifier rubyid_cached_until'>cached_until</span> <span class='op'>></span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='rparen'>)</span>
|
1064
|
+
<span class='kw'>end</span></pre>
|
1065
|
+
</td>
|
1066
|
+
</tr>
|
1067
|
+
</table>
|
1068
|
+
</div>
|
1069
|
+
|
1070
|
+
<div class="method_details ">
|
1071
|
+
<h3 class="signature " id="cached_until-instance_method">
|
1072
|
+
|
1073
|
+
#<strong>cached_until</strong> ⇒ <tt>Time</tt><sup>?</sup>
|
1074
|
+
|
1075
|
+
|
1076
|
+
|
1077
|
+
|
1078
|
+
|
1079
|
+
</h3><div class="docstring">
|
1080
|
+
<div class="discussion">
|
1081
|
+
|
1082
|
+
<p>Returns time when the cache expires and the resource can be refreshed
|
1083
|
+
(sends an HTTP request)</p>
|
1084
|
+
|
1085
|
+
|
1086
|
+
</div>
|
1087
|
+
</div>
|
1088
|
+
<div class="tags">
|
1089
|
+
|
1090
|
+
<p class="tag_title">Returns:</p>
|
1091
|
+
<ul class="return">
|
1092
|
+
|
1093
|
+
<li>
|
1094
|
+
|
1095
|
+
|
1096
|
+
<span class='type'>(<tt>Time</tt>, <tt>nil</tt>)</span>
|
1097
|
+
|
1098
|
+
|
1099
|
+
|
1100
|
+
—
|
1101
|
+
<div class='inline'>
|
1102
|
+
<p>time when the cache expires and the resource can be refreshed (sends an
|
1103
|
+
HTTP request)</p>
|
1104
|
+
</div>
|
1105
|
+
|
1106
|
+
</li>
|
1107
|
+
|
1108
|
+
</ul>
|
1109
|
+
|
1110
|
+
</div><table class="source_code">
|
1111
|
+
<tr>
|
1112
|
+
<td>
|
1113
|
+
<pre class="lines">
|
1114
|
+
|
1115
|
+
|
1116
|
+
164
|
1117
|
+
165
|
1118
|
+
166
|
1119
|
+
167
|
1120
|
+
168
|
1121
|
+
169</pre>
|
1122
|
+
</td>
|
1123
|
+
<td>
|
1124
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 164</span>
|
1125
|
+
|
1126
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cached_until'>cached_until</span>
|
1127
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@xml_element</span>
|
1128
|
+
|
1129
|
+
<span class='id identifier rubyid__cached_until'>_cached_until</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>eveapi/cachedUntil/?[0]</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
1130
|
+
<span class='id identifier rubyid__cached_until'>_cached_until</span> <span class='op'>?</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid__cached_until'>_cached_until</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> UTC</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
|
1131
|
+
<span class='kw'>end</span></pre>
|
1132
|
+
</td>
|
1133
|
+
</tr>
|
1134
|
+
</table>
|
1135
|
+
</div>
|
1136
|
+
|
1137
|
+
<div class="method_details ">
|
1138
|
+
<h3 class="signature " id="inspect-instance_method">
|
1139
|
+
|
1140
|
+
#<strong>inspect</strong> ⇒ <tt>Object</tt>
|
1141
|
+
|
1142
|
+
|
1143
|
+
|
1144
|
+
|
1145
|
+
|
1146
|
+
</h3><div class="docstring">
|
1147
|
+
<div class="discussion">
|
1148
|
+
|
1149
|
+
<p>:nodoc:</p>
|
1150
|
+
|
1151
|
+
|
1152
|
+
</div>
|
1153
|
+
</div>
|
1154
|
+
<div class="tags">
|
1155
|
+
|
1156
|
+
|
1157
|
+
</div><table class="source_code">
|
1158
|
+
<tr>
|
1159
|
+
<td>
|
1160
|
+
<pre class="lines">
|
1161
|
+
|
1162
|
+
|
1163
|
+
172
|
1164
|
+
173
|
1165
|
+
174
|
1166
|
+
175
|
1167
|
+
176
|
1168
|
+
177
|
1169
|
+
178
|
1170
|
+
179
|
1171
|
+
180
|
1172
|
+
181</pre>
|
1173
|
+
</td>
|
1174
|
+
<td>
|
1175
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 172</span>
|
1176
|
+
|
1177
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
|
1178
|
+
<span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
1179
|
+
|
1180
|
+
<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>
|
1181
|
+
<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'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</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'>"</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'>"</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'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1182
|
+
<span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</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'>"</span></span>
|
1183
|
+
<span class='kw'>end</span>
|
1184
|
+
|
1185
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>#<</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'>></span><span class='tstring_end'>"</span></span>
|
1186
|
+
<span class='kw'>end</span></pre>
|
1187
|
+
</td>
|
1188
|
+
</tr>
|
1189
|
+
</table>
|
1190
|
+
</div>
|
1191
|
+
|
1192
|
+
<div class="method_details ">
|
1193
|
+
<h3 class="signature " id="refresh-instance_method">
|
1194
|
+
|
1195
|
+
#<strong>refresh</strong> ⇒ <tt>Object</tt>
|
1196
|
+
|
1197
|
+
|
1198
|
+
|
1199
|
+
|
1200
|
+
|
1201
|
+
</h3><div class="docstring">
|
1202
|
+
<div class="discussion">
|
1203
|
+
|
1204
|
+
<p>Query the API, refreshing this object's data.</p>
|
1205
|
+
|
1206
|
+
|
1207
|
+
</div>
|
1208
|
+
</div>
|
1209
|
+
<div class="tags">
|
1210
|
+
|
1211
|
+
<p class="tag_title">Returns:</p>
|
1212
|
+
<ul class="return">
|
1213
|
+
|
1214
|
+
<li>
|
1215
|
+
|
1216
|
+
|
1217
|
+
<span class='type'></span>
|
1218
|
+
|
1219
|
+
|
1220
|
+
|
1221
|
+
|
1222
|
+
<div class='inline'>
|
1223
|
+
<p>true if the endpoint was fetched (HTTP request sent), false if the cache
|
1224
|
+
hasn't expired</p>
|
1225
|
+
</div>
|
1226
|
+
|
1227
|
+
</li>
|
1228
|
+
|
1229
|
+
</ul>
|
1230
|
+
|
1231
|
+
</div><table class="source_code">
|
1232
|
+
<tr>
|
1233
|
+
<td>
|
1234
|
+
<pre class="lines">
|
1235
|
+
|
1236
|
+
|
1237
|
+
149
|
1238
|
+
150
|
1239
|
+
151
|
1240
|
+
152
|
1241
|
+
153
|
1242
|
+
154</pre>
|
1243
|
+
</td>
|
1244
|
+
<td>
|
1245
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 149</span>
|
1246
|
+
|
1247
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_refresh'>refresh</span>
|
1248
|
+
<span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_cache_expired?'>cache_expired?</span>
|
1249
|
+
|
1250
|
+
<span class='id identifier rubyid_fetch'>fetch</span>
|
1251
|
+
<span class='kw'>true</span>
|
1252
|
+
<span class='kw'>end</span></pre>
|
1253
|
+
</td>
|
1254
|
+
</tr>
|
1255
|
+
</table>
|
1256
|
+
</div>
|
1257
|
+
|
1258
|
+
<div class="method_details ">
|
1259
|
+
<h3 class="signature " id="to_h-instance_method">
|
1260
|
+
|
1261
|
+
#<strong>to_h</strong> ⇒ <tt>Hash</tt>
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
|
1266
|
+
|
1267
|
+
</h3><div class="docstring">
|
1268
|
+
<div class="discussion">
|
1269
|
+
|
1270
|
+
<p>Returns a hash of non-nil attributes</p>
|
1271
|
+
|
1272
|
+
|
1273
|
+
</div>
|
1274
|
+
</div>
|
1275
|
+
<div class="tags">
|
1276
|
+
|
1277
|
+
<p class="tag_title">Returns:</p>
|
1278
|
+
<ul class="return">
|
1279
|
+
|
1280
|
+
<li>
|
1281
|
+
|
1282
|
+
|
1283
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
—
|
1288
|
+
<div class='inline'>
|
1289
|
+
<p>a hash of non-nil attributes</p>
|
1290
|
+
</div>
|
1291
|
+
|
1292
|
+
</li>
|
1293
|
+
|
1294
|
+
</ul>
|
1295
|
+
|
1296
|
+
</div><table class="source_code">
|
1297
|
+
<tr>
|
1298
|
+
<td>
|
1299
|
+
<pre class="lines">
|
1300
|
+
|
1301
|
+
|
1302
|
+
194
|
1303
|
+
195
|
1304
|
+
196
|
1305
|
+
197
|
1306
|
+
198
|
1307
|
+
199
|
1308
|
+
200
|
1309
|
+
201
|
1310
|
+
202
|
1311
|
+
203
|
1312
|
+
204
|
1313
|
+
205</pre>
|
1314
|
+
</td>
|
1315
|
+
<td>
|
1316
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 194</span>
|
1317
|
+
|
1318
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
|
1319
|
+
<span class='id identifier rubyid_attributes'>attributes</span><span class='period'>
|
1320
|
+
</span><span class='id identifier rubyid_ .keys'> .keys</span><span class='period'>
|
1321
|
+
</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='op'>|</span>
|
1322
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</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>
|
1323
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Rowset</span><span class='rparen'>)</span>
|
1324
|
+
|
1325
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
1326
|
+
<span class='rbrace'>}</span><span class='period'>
|
1327
|
+
</span><span class='id identifier rubyid_ .to_h'> .to_h</span><span class='period'>
|
1328
|
+
</span><span class='id identifier rubyid_ .reject'> .reject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
1329
|
+
<span class='kw'>end</span></pre>
|
1330
|
+
</td>
|
1331
|
+
</tr>
|
1332
|
+
</table>
|
1333
|
+
</div>
|
1334
|
+
|
1335
|
+
<div class="method_details ">
|
1336
|
+
<h3 class="signature " id="to_s-instance_method">
|
1337
|
+
|
1338
|
+
#<strong>to_s</strong> ⇒ <tt>String</tt>
|
1339
|
+
|
1340
|
+
|
1341
|
+
|
1342
|
+
|
1343
|
+
|
1344
|
+
</h3><div class="docstring">
|
1345
|
+
<div class="discussion">
|
1346
|
+
|
1347
|
+
<p>Returns a string representation of the non-nil attributes</p>
|
1348
|
+
|
1349
|
+
|
1350
|
+
</div>
|
1351
|
+
</div>
|
1352
|
+
<div class="tags">
|
1353
|
+
|
1354
|
+
<p class="tag_title">Returns:</p>
|
1355
|
+
<ul class="return">
|
1356
|
+
|
1357
|
+
<li>
|
1358
|
+
|
1359
|
+
|
1360
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1361
|
+
|
1362
|
+
|
1363
|
+
|
1364
|
+
—
|
1365
|
+
<div class='inline'>
|
1366
|
+
<p>a string representation of the non-nil attributes</p>
|
1367
|
+
</div>
|
1368
|
+
|
1369
|
+
</li>
|
1370
|
+
|
1371
|
+
</ul>
|
1372
|
+
|
1373
|
+
</div><table class="source_code">
|
1374
|
+
<tr>
|
1375
|
+
<td>
|
1376
|
+
<pre class="lines">
|
1377
|
+
|
1378
|
+
|
1379
|
+
184
|
1380
|
+
185
|
1381
|
+
186
|
1382
|
+
187
|
1383
|
+
188
|
1384
|
+
189
|
1385
|
+
190
|
1386
|
+
191</pre>
|
1387
|
+
</td>
|
1388
|
+
<td>
|
1389
|
+
<pre class="code"><span class="info file"># File 'lib/greeve/base_item.rb', line 184</span>
|
1390
|
+
|
1391
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
1392
|
+
<span class='id identifier rubyid_to_h'>to_h</span><span class='period'>
|
1393
|
+
</span><span class='id identifier rubyid_ .map'> .map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
|
1394
|
+
<span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>F</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>BigDecimal</span><span class='rparen'>)</span>
|
1395
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1396
|
+
<span class='rbrace'>}</span><span class='period'>
|
1397
|
+
</span><span class='id identifier rubyid_ .join'> .join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1398
|
+
<span class='kw'>end</span></pre>
|
1399
|
+
</td>
|
1400
|
+
</tr>
|
1401
|
+
</table>
|
1402
|
+
</div>
|
1403
|
+
|
1404
|
+
</div>
|
1405
|
+
|
1406
|
+
</div>
|
1407
|
+
|
1408
|
+
<div id="footer">
|
1409
|
+
Generated on Wed Aug 24 18:52:46 2016 by
|
1410
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1411
|
+
0.9.5 (ruby-2.1.7).
|
1412
|
+
</div>
|
1413
|
+
|
1414
|
+
</div>
|
1415
|
+
</body>
|
1416
|
+
</html>
|