time_span 0.0.1.beta.01 → 0.0.2
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.
- data/.gitignore +2 -1
- data/Gemfile.lock +24 -0
- data/README.md +12 -3
- data/doc/TimeSpan/RelativeTime.html +646 -329
- data/doc/TimeSpan/TimeLine.html +1705 -542
- data/doc/TimeSpan/TimeSpan.html +2764 -889
- data/doc/TimeSpan.html +118 -142
- data/doc/_index.html +135 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +85 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +69 -124
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +13 -29
- data/doc/method_list.html +462 -0
- data/doc/top-level-namespace.html +105 -0
- data/lib/time_span/version.rb +1 -1
- data/lib/time_span.rb +196 -72
- data/spec/time_span/time_span_spec.rb +12 -3
- metadata +21 -9
@@ -1,419 +1,736 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
-
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
-
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
-
|
17
|
-
</head>
|
18
|
-
<body id="top" class="class">
|
19
|
-
|
20
|
-
<div id="metadata">
|
21
|
-
<div id="home-metadata">
|
22
|
-
<div id="home-section" class="section">
|
23
|
-
<h3 class="section-header">
|
24
|
-
<a href="../index.html">Home</a>
|
25
|
-
<a href="../index.html#classes">Classes</a>
|
26
|
-
<a href="../index.html#methods">Methods</a>
|
27
|
-
</h3>
|
28
|
-
</div>
|
29
|
-
</div>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: TimeSpan::RelativeTime
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.5
|
10
|
+
|
11
|
+
</title>
|
30
12
|
|
31
|
-
|
32
|
-
<div id="file-list-section" class="section">
|
33
|
-
<h3 class="section-header">In Files</h3>
|
34
|
-
<div class="section-body">
|
35
|
-
<ul>
|
36
|
-
|
37
|
-
<li><a href="../lib/time_span_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
-
class="thickbox" title="lib/time_span.rb">lib/time_span.rb</a></li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</div>
|
42
|
-
</div>
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
43
14
|
|
44
|
-
|
45
|
-
</div>
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
46
16
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
<h3 class="section-header">Parent</h3>
|
52
|
-
|
53
|
-
<p class="link">Object</p>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
57
21
|
|
58
|
-
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
59
23
|
|
60
|
-
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
61
25
|
|
62
|
-
|
63
|
-
<!-- Method Quickref -->
|
64
|
-
<div id="method-list-section" class="section">
|
65
|
-
<h3 class="section-header">Methods</h3>
|
66
|
-
<ul class="link-list">
|
67
|
-
|
68
|
-
<li><a href="#method-c-new">::new</a></li>
|
69
|
-
|
70
|
-
<li><a href="#method-i-colinear_with-3F">#colinear_with?</a></li>
|
71
|
-
|
72
|
-
<li><a href="#method-i-positioned-3F">#positioned?</a></li>
|
73
|
-
|
74
|
-
<li><a href="#method-i-to_s">#to_s</a></li>
|
75
|
-
|
76
|
-
<li><a href="#method-i-valid_and_comparable_with-3F">#valid_and_comparable_with?</a></li>
|
77
|
-
|
78
|
-
</ul>
|
79
|
-
</div>
|
80
|
-
|
81
26
|
|
82
|
-
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../_index.html">Index (R)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../TimeSpan.html" title="TimeSpan (module)">TimeSpan</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">RelativeTime</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
83
55
|
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Class: TimeSpan::RelativeTime
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
84
64
|
|
85
|
-
|
86
|
-
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
87
70
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
<li class="file"><a href="../Rakefile.html">Rakefile</a></li>
|
95
|
-
|
96
|
-
</ul>
|
97
|
-
</div>
|
98
|
-
|
99
|
-
|
100
|
-
<div id="classindex-section" class="section project-section">
|
101
|
-
<h3 class="section-header">Class/Module Index
|
102
|
-
<span class="search-toggle"><img src="../images/find.png"
|
103
|
-
height="16" width="16" alt="[+]"
|
104
|
-
title="show/hide quicksearch" /></span></h3>
|
105
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
106
|
-
<fieldset>
|
107
|
-
<legend>Quicksearch</legend>
|
108
|
-
<input type="text" name="quicksearch" value=""
|
109
|
-
class="quicksearch-field" />
|
110
|
-
</fieldset>
|
111
|
-
</form>
|
112
|
-
|
113
|
-
<ul class="link-list">
|
114
|
-
|
115
|
-
<li><a href="../TimeSpan.html">TimeSpan</a></li>
|
116
|
-
|
117
|
-
<li><a href="../TimeSpan/RelativeTime.html">TimeSpan::RelativeTime</a></li>
|
118
|
-
|
119
|
-
<li><a href="../TimeSpan/TimeLine.html">TimeSpan::TimeLine</a></li>
|
120
|
-
|
121
|
-
<li><a href="../TimeSpan/TimeSpan.html">TimeSpan::TimeSpan</a></li>
|
122
|
-
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">TimeSpan::RelativeTime</li>
|
75
|
+
|
123
76
|
</ul>
|
124
|
-
<
|
125
|
-
</div>
|
126
|
-
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
127
78
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dt class="r2 last">Defined in:</dt>
|
90
|
+
<dd class="r2 last">lib/time_span.rb</dd>
|
91
|
+
|
92
|
+
</dl>
|
93
|
+
<div class="clear"></div>
|
133
94
|
|
134
|
-
|
135
|
-
|
136
|
-
|
95
|
+
<h2>Overview</h2><div class="docstring">
|
96
|
+
<div class="discussion">
|
97
|
+
|
98
|
+
<p>class RelativeTime
|
137
99
|
#</p>
|
138
100
|
|
139
|
-
<pre>#</pre>
|
101
|
+
<pre class="code ruby"><code><span class='comment'>#</span></code></pre>
|
140
102
|
|
141
103
|
<p>public methods:
|
142
104
|
#</p>
|
143
105
|
|
144
|
-
<pre>comparators: < <= == != >= > #
|
106
|
+
<pre class="code ruby"><code>comparators: < <= == != >= > #
|
145
107
|
work on any two RelativeTime objects on the same TimeLine #
|
146
108
|
positioned? #
|
147
109
|
true if a RelativeTime has been put on a TimeLine # #
|
148
110
|
colinear_with?(RelativeTime.new) #
|
149
111
|
true if both RelativeTime objects are positioned and on same TimeLine #
|
150
|
-
#</pre>
|
112
|
+
#</code></pre>
|
151
113
|
|
152
114
|
<p>protected method:
|
153
115
|
#</p>
|
154
116
|
|
155
|
-
<pre>valid_and_comparable_with?(RelativeTime) #
|
117
|
+
<pre class="code ruby"><code>valid_and_comparable_with?(RelativeTime) #
|
156
118
|
true if #
|
157
|
-
#</pre>
|
119
|
+
#</code></pre>
|
158
120
|
|
159
121
|
<p>diff cannot be done, it makes no sense, due to the fuzziness
|
160
122
|
#</p>
|
161
123
|
|
162
|
-
<pre>
|
163
|
-
RelativeTime must be within a TimeLine
|
124
|
+
<pre class="code ruby"><code> <span class='comment'>#
|
125
|
+
</span><span class='const'>RelativeTime</span> <span class='id identifier rubyid_must'>must</span> <span class='id identifier rubyid_be'>be</span> <span class='id identifier rubyid_within'>within</span> <span class='id identifier rubyid_a'>a</span> <span class='const'>TimeLine</span> <span class='comment'>#</span></code></pre>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
<div class="tags">
|
131
|
+
|
132
|
+
<h3>Author:</h3>
|
133
|
+
<ul class="author">
|
134
|
+
|
135
|
+
<li>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
<div class='inline'>
|
142
|
+
<p>Craig A. Cook</p>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</li>
|
146
|
+
|
147
|
+
</ul>
|
164
148
|
|
165
|
-
|
149
|
+
</div>
|
166
150
|
|
151
|
+
|
152
|
+
|
153
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
154
|
+
<ul class="summary">
|
167
155
|
|
156
|
+
<li class="public ">
|
157
|
+
<span class="summary_signature">
|
168
158
|
|
159
|
+
<a href="#time_line-instance_method" title="#time_line (instance method)">- (Object) <strong>time_line</strong> </a>
|
169
160
|
|
170
|
-
<div id="5Buntitled-5D" class="documentation-section">
|
171
|
-
|
172
161
|
|
173
|
-
|
162
|
+
|
163
|
+
</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
174
173
|
|
175
|
-
|
174
|
+
|
175
|
+
<span class="summary_desc"><div class='inline'>
|
176
|
+
<p>Returns the value of attribute time_line.</p>
|
177
|
+
</div></span>
|
178
|
+
|
179
|
+
</li>
|
176
180
|
|
177
|
-
|
178
|
-
|
179
|
-
<div id="attribute-method-details" class="method-section section">
|
180
|
-
<h3 class="section-header">Attributes</h3>
|
181
|
+
|
182
|
+
</ul>
|
181
183
|
|
182
|
-
|
183
|
-
<div id="reference_to-attribute-method" class="method-detail">
|
184
|
-
<a name="reference_to"></a>
|
185
|
-
|
186
|
-
<a name="reference_to="></a>
|
187
|
-
|
188
|
-
<div class="method-heading attribute-method-heading">
|
189
|
-
<span class="method-name">reference_to</span><span
|
190
|
-
class="attribute-access-type">[RW]</span>
|
191
|
-
</div>
|
192
184
|
|
193
|
-
<div class="method-description">
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
</div>
|
198
|
-
</div>
|
199
|
-
|
200
|
-
<div id="timeline-attribute-method" class="method-detail">
|
201
|
-
<a name="timeline"></a>
|
202
|
-
|
203
|
-
<a name="timeline="></a>
|
204
|
-
|
205
|
-
<div class="method-heading attribute-method-heading">
|
206
|
-
<span class="method-name">timeline</span><span
|
207
|
-
class="attribute-access-type">[RW]</span>
|
208
|
-
</div>
|
209
185
|
|
210
|
-
<div class="method-description">
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
</div>
|
215
|
-
</div>
|
216
|
-
|
217
|
-
</div><!-- attribute-method-details -->
|
218
|
-
|
219
186
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
187
|
+
|
188
|
+
<h2>
|
189
|
+
Instance Method Summary
|
190
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
191
|
+
</h2>
|
224
192
|
|
193
|
+
<ul class="summary">
|
225
194
|
|
226
|
-
<
|
227
|
-
|
195
|
+
<li class="public ">
|
196
|
+
<span class="summary_signature">
|
197
|
+
|
198
|
+
<a href="#colinear_with%3F-instance_method" title="#colinear_with? (instance method)">- (Boolean) <strong>colinear_with?</strong>(other_relative_time) </a>
|
199
|
+
|
228
200
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
201
|
+
|
202
|
+
</span>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
236
209
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
<div class="method-source-code" id="new-source">
|
244
|
-
<pre>
|
245
|
-
<span class="ruby-comment"># File lib/time_span.rb, line 261</span>
|
246
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">tline</span>, <span class="ruby-identifier">ref</span>
|
247
|
-
<span class="ruby-ivar">@timeline</span>= <span class="ruby-identifier">tline</span>
|
248
|
-
<span class="ruby-ivar">@reference_to</span>= <span class="ruby-identifier">ref</span>
|
249
|
-
<span class="ruby-keyword">end</span></pre>
|
250
|
-
</div><!-- new-source -->
|
251
|
-
|
252
|
-
</div>
|
210
|
+
|
211
|
+
<span class="summary_desc"><div class='inline'>
|
212
|
+
<p>True if both are on the same TimeLine.</p>
|
213
|
+
</div></span>
|
214
|
+
|
215
|
+
</li>
|
253
216
|
|
254
|
-
|
217
|
+
|
218
|
+
<li class="public ">
|
219
|
+
<span class="summary_signature">
|
220
|
+
|
221
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Object) <strong>initialize</strong>(tline, ref) </a>
|
222
|
+
|
255
223
|
|
256
|
-
|
257
|
-
|
224
|
+
|
225
|
+
</span>
|
226
|
+
|
227
|
+
<span class="note title constructor">constructor</span>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
<span class="summary_desc"><div class='inline'>
|
237
|
+
<p>create a realtive time *within a time_line* after position.</p>
|
238
|
+
</div></span>
|
239
|
+
|
240
|
+
</li>
|
258
241
|
|
259
242
|
|
260
|
-
|
243
|
+
<li class="public ">
|
244
|
+
<span class="summary_signature">
|
245
|
+
|
246
|
+
<a href="#meth-instance_method" title="#meth (instance method)">- (Boolean) <strong>meth</strong> </a>
|
261
247
|
|
262
|
-
|
263
|
-
|
248
|
+
|
249
|
+
|
250
|
+
</span>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<span class="summary_desc"><div class='inline'>
|
260
|
+
<p>comparator methods any method on fixnum with 1 RelativeTime param can be in
|
261
|
+
the list below.</p>
|
262
|
+
</div></span>
|
263
|
+
|
264
|
+
</li>
|
264
265
|
|
265
266
|
|
266
|
-
<
|
267
|
-
|
267
|
+
<li class="public ">
|
268
|
+
<span class="summary_signature">
|
269
|
+
|
270
|
+
<a href="#positioned%3F-instance_method" title="#positioned? (instance method)">- (Boolean) <strong>positioned?</strong> </a>
|
271
|
+
|
268
272
|
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
273
|
+
|
274
|
+
</span>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
276
281
|
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
<div class="method-source-code" id="colinear_with-3F-source">
|
284
|
-
<pre>
|
285
|
-
<span class="ruby-comment"># File lib/time_span.rb, line 282</span>
|
286
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">colinear_with?</span>(<span class="ruby-identifier">b</span>)
|
287
|
-
<span class="ruby-identifier">b</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">positioned?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">positioned?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">timeline</span>.<span class="ruby-identifier">equal?</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">timeline</span>)
|
288
|
-
<span class="ruby-keyword">end</span></pre>
|
289
|
-
</div><!-- colinear_with-3F-source -->
|
290
|
-
|
291
|
-
</div>
|
282
|
+
|
283
|
+
<span class="summary_desc"><div class='inline'>
|
284
|
+
<p>True if self has been properly placed on a TimeLine.</p>
|
285
|
+
</div></span>
|
286
|
+
|
287
|
+
</li>
|
292
288
|
|
293
|
-
|
289
|
+
|
290
|
+
<li class="public ">
|
291
|
+
<span class="summary_signature">
|
292
|
+
|
293
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong> </a>
|
294
|
+
|
294
295
|
|
295
|
-
|
296
|
-
|
296
|
+
|
297
|
+
</span>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
<span class="summary_desc"><div class='inline'>
|
307
|
+
<p>The string representation of referenced object.</p>
|
308
|
+
</div></span>
|
309
|
+
|
310
|
+
</li>
|
297
311
|
|
298
312
|
|
299
|
-
|
300
|
-
|
313
|
+
</ul>
|
314
|
+
|
301
315
|
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
316
|
+
<div id="constructor_details" class="method_details_list">
|
317
|
+
<h2>Constructor Details</h2>
|
318
|
+
|
319
|
+
<div class="method_details first">
|
320
|
+
<p class="signature first" id="initialize-instance_method">
|
321
|
+
|
322
|
+
- (<tt>Object</tt>) <strong>initialize</strong>(tline, ref)
|
323
|
+
|
309
324
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
<div class="method-source-code" id="positioned-3F-source">
|
317
|
-
<pre>
|
318
|
-
<span class="ruby-comment"># File lib/time_span.rb, line 278</span>
|
319
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">positioned?</span>
|
320
|
-
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">timeline</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">timeline</span>.<span class="ruby-identifier">indices_of</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword">self</span>)
|
321
|
-
<span class="ruby-keyword">end</span></pre>
|
322
|
-
</div><!-- positioned-3F-source -->
|
323
|
-
|
324
|
-
</div>
|
325
|
+
|
326
|
+
</p><div class="docstring">
|
327
|
+
<div class="discussion">
|
328
|
+
|
329
|
+
<p>create a realtive time *within a time_line* after position</p>
|
325
330
|
|
326
|
-
|
327
331
|
|
328
|
-
|
329
|
-
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
<div class="tags">
|
335
|
+
<h3>Parameters:</h3>
|
336
|
+
<ul class="param">
|
337
|
+
|
338
|
+
<li>
|
339
|
+
|
340
|
+
<span class='name'>tline</span>
|
341
|
+
|
342
|
+
|
343
|
+
<span class='type'>(<tt><span class='object_link'><a href="TimeLine.html" title="TimeSpan::TimeLine (class)">TimeSpan::TimeLine</a></span></tt>)</span>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
—
|
348
|
+
<div class='inline'>
|
349
|
+
<p>TimeLIne on which this RelativeTime is placed</p>
|
350
|
+
</div>
|
351
|
+
|
352
|
+
</li>
|
353
|
+
|
354
|
+
<li>
|
355
|
+
|
356
|
+
<span class='name'>ref</span>
|
357
|
+
|
358
|
+
|
359
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
—
|
364
|
+
<div class='inline'>
|
365
|
+
<p>the object placed on the timeline</p>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
</li>
|
369
|
+
|
370
|
+
</ul>
|
371
|
+
|
372
|
+
|
373
|
+
</div><table class="source_code">
|
374
|
+
<tr>
|
375
|
+
<td>
|
376
|
+
<pre class="lines">
|
377
|
+
|
378
|
+
|
379
|
+
401
|
380
|
+
402
|
381
|
+
403
|
382
|
+
404</pre>
|
383
|
+
</td>
|
384
|
+
<td>
|
385
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 401</span>
|
386
|
+
|
387
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_tline'>tline</span><span class='comma'>,</span> <span class='id identifier rubyid_ref'>ref</span>
|
388
|
+
<span class='ivar'>@time_line</span><span class='op'>=</span> <span class='id identifier rubyid_tline'>tline</span>
|
389
|
+
<span class='ivar'>@reference_to</span><span class='op'>=</span> <span class='id identifier rubyid_ref'>ref</span>
|
390
|
+
<span class='kw'>end</span></pre>
|
391
|
+
</td>
|
392
|
+
</tr>
|
393
|
+
</table>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
</div>
|
330
397
|
|
398
|
+
<div id="instance_attr_details" class="attr_details">
|
399
|
+
<h2>Instance Attribute Details</h2>
|
400
|
+
|
331
401
|
|
332
|
-
|
333
|
-
|
402
|
+
<span id="time_line=-instance_method"></span>
|
403
|
+
<span id="time_line-instance_method"></span>
|
404
|
+
<div class="method_details first">
|
405
|
+
<p class="signature first" id="time_line-instance_method">
|
406
|
+
|
407
|
+
- (<tt>Object</tt>) <strong>time_line</strong>
|
408
|
+
|
334
409
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
</div>
|
341
|
-
|
410
|
+
|
411
|
+
</p><div class="docstring">
|
412
|
+
<div class="discussion">
|
413
|
+
|
414
|
+
<p>Returns the value of attribute time_line</p>
|
342
415
|
|
343
|
-
<div class="method-description">
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
<div class="method-source-code" id="to_s-source">
|
350
|
-
<pre>
|
351
|
-
<span class="ruby-comment"># File lib/time_span.rb, line 266</span>
|
352
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
353
|
-
<span class="ruby-identifier">reference_to</span>.<span class="ruby-identifier">to_s</span>
|
354
|
-
<span class="ruby-keyword">end</span></pre>
|
355
|
-
</div><!-- to_s-source -->
|
356
|
-
|
357
|
-
</div>
|
358
416
|
|
359
|
-
|
417
|
+
</div>
|
418
|
+
</div>
|
419
|
+
<div class="tags">
|
420
|
+
|
360
421
|
|
361
|
-
|
362
|
-
|
422
|
+
</div><table class="source_code">
|
423
|
+
<tr>
|
424
|
+
<td>
|
425
|
+
<pre class="lines">
|
426
|
+
|
427
|
+
|
428
|
+
394
|
429
|
+
395
|
430
|
+
396</pre>
|
431
|
+
</td>
|
432
|
+
<td>
|
433
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 394</span>
|
434
|
+
|
435
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_time_line'>time_line</span>
|
436
|
+
<span class='ivar'>@time_line</span>
|
437
|
+
<span class='kw'>end</span></pre>
|
438
|
+
</td>
|
439
|
+
</tr>
|
440
|
+
</table>
|
441
|
+
</div>
|
442
|
+
|
443
|
+
</div>
|
363
444
|
|
364
|
-
|
365
|
-
|
445
|
+
|
446
|
+
<div id="instance_method_details" class="method_details_list">
|
447
|
+
<h2>Instance Method Details</h2>
|
448
|
+
|
449
|
+
|
450
|
+
<div class="method_details first">
|
451
|
+
<p class="signature first" id="colinear_with?-instance_method">
|
452
|
+
|
453
|
+
- (<tt>Boolean</tt>) <strong>colinear_with?</strong>(other_relative_time)
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</p><div class="docstring">
|
458
|
+
<div class="discussion">
|
366
459
|
|
367
|
-
|
368
|
-
<h3 class="section-header">Protected Instance Methods</h3>
|
460
|
+
<p>True if both are on the same TimeLine</p>
|
369
461
|
|
462
|
+
|
463
|
+
</div>
|
464
|
+
</div>
|
465
|
+
<div class="tags">
|
466
|
+
<h3>Parameters:</h3>
|
467
|
+
<ul class="param">
|
468
|
+
|
469
|
+
<li>
|
470
|
+
|
471
|
+
<span class='name'>other</span>
|
472
|
+
|
370
473
|
|
371
|
-
<
|
372
|
-
|
474
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="TimeSpan::RelativeTime (class)">TimeSpan::RelativeTime</a></span></tt>)</span>
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
—
|
479
|
+
<div class='inline'>
|
480
|
+
<p>time to be sure is on self's TimeLIne</p>
|
481
|
+
</div>
|
482
|
+
|
483
|
+
</li>
|
484
|
+
|
485
|
+
</ul>
|
373
486
|
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
487
|
+
<h3>Returns:</h3>
|
488
|
+
<ul class="return">
|
489
|
+
|
490
|
+
<li>
|
491
|
+
|
492
|
+
|
493
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
—
|
498
|
+
<div class='inline'>
|
499
|
+
<p>true if both are on the same TimeLine</p>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
</li>
|
503
|
+
|
504
|
+
</ul>
|
505
|
+
|
506
|
+
</div><table class="source_code">
|
507
|
+
<tr>
|
508
|
+
<td>
|
509
|
+
<pre class="lines">
|
510
|
+
|
511
|
+
|
512
|
+
429
|
513
|
+
430
|
514
|
+
431</pre>
|
515
|
+
</td>
|
516
|
+
<td>
|
517
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 429</span>
|
518
|
+
|
519
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_colinear_with?'>colinear_with?</span><span class='lparen'>(</span><span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='rparen'>)</span>
|
520
|
+
<span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='period'>.</span><span class='id identifier rubyid_positioned?'>positioned?</span> <span class='op'>&&</span> <span class='id identifier rubyid_positioned?'>positioned?</span> <span class='op'>&&</span> <span class='id identifier rubyid_time_line'>time_line</span><span class='period'>.</span><span class='id identifier rubyid_equal?'>equal?</span><span class='lparen'>(</span><span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='period'>.</span><span class='id identifier rubyid_time_line'>time_line</span><span class='rparen'>)</span>
|
521
|
+
<span class='kw'>end</span></pre>
|
522
|
+
</td>
|
523
|
+
</tr>
|
524
|
+
</table>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="method_details ">
|
528
|
+
<p class="signature " id="meth-instance_method">
|
529
|
+
|
530
|
+
- (<tt>Boolean</tt>) <strong>meth</strong>
|
531
|
+
|
381
532
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
<div class="method-source-code" id="valid_and_comparable_with-3F-source">
|
389
|
-
<pre>
|
390
|
-
<span class="ruby-comment"># File lib/time_span.rb, line 289</span>
|
391
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">valid_and_comparable_with?</span>(<span class="ruby-identifier">b</span>)
|
392
|
-
<span class="ruby-operator">!</span><span class="ruby-keyword">self</span>.<span class="ruby-identifier">timeline</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">timeline</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">colinear_with?</span>(<span class="ruby-identifier">b</span>)
|
393
|
-
<span class="ruby-keyword">end</span></pre>
|
394
|
-
</div><!-- valid_and_comparable_with-3F-source -->
|
395
|
-
|
396
|
-
</div>
|
533
|
+
|
534
|
+
</p><div class="docstring">
|
535
|
+
<div class="discussion">
|
536
|
+
|
537
|
+
<p>comparator methods any method on fixnum with 1 RelativeTime param can be in
|
538
|
+
the list below</p>
|
397
539
|
|
398
|
-
|
399
540
|
|
400
|
-
|
401
|
-
|
541
|
+
</div>
|
542
|
+
</div>
|
543
|
+
<div class="tags">
|
544
|
+
<h3>Parameters:</h3>
|
545
|
+
<ul class="param">
|
546
|
+
|
547
|
+
<li>
|
548
|
+
|
549
|
+
<span class='name'>other_relative_time</span>
|
550
|
+
|
551
|
+
|
552
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="TimeSpan::RelativeTime (class)">TimeSpan::RelativeTime</a></span></tt>)</span>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
—
|
557
|
+
<div class='inline'>
|
558
|
+
<p>time being compared to</p>
|
559
|
+
</div>
|
560
|
+
|
561
|
+
</li>
|
562
|
+
|
563
|
+
</ul>
|
402
564
|
|
565
|
+
<h3>Returns:</h3>
|
566
|
+
<ul class="return">
|
567
|
+
|
568
|
+
<li>
|
569
|
+
|
403
570
|
|
404
|
-
|
571
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
—
|
576
|
+
<div class='inline'>
|
577
|
+
<p>depending on the relationship</p>
|
578
|
+
</div>
|
579
|
+
|
580
|
+
</li>
|
581
|
+
|
582
|
+
</ul>
|
583
|
+
|
584
|
+
</div><table class="source_code">
|
585
|
+
<tr>
|
586
|
+
<td>
|
587
|
+
<pre class="lines">
|
588
|
+
|
589
|
+
|
590
|
+
415
|
591
|
+
416
|
592
|
+
417
|
593
|
+
418
|
594
|
+
419
|
595
|
+
420</pre>
|
596
|
+
</td>
|
597
|
+
<td>
|
598
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 415</span>
|
599
|
+
|
600
|
+
<span class='qwords_beg'>%w{</span><span class='tstring_content'><</span><span class='words_sep'> </span><span class='tstring_content'><=</span><span class='words_sep'> </span><span class='tstring_content'>==</span><span class='words_sep'> </span><span class='tstring_content'>!=</span><span class='words_sep'> </span><span class='tstring_content'>>=</span><span class='words_sep'> </span><span class='tstring_content'>></span><span class='words_sep'>}</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_meth'>meth</span><span class='op'>|</span>
|
601
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:define_method</span><span class='comma'>,</span> <span class='id identifier rubyid_meth'>meth</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='op'>|</span>
|
602
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>can only compare to other times on the same time_line.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_valid_and_comparable_with?'>valid_and_comparable_with?</span><span class='lparen'>(</span><span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='rparen'>)</span> <span class='comment'># can NOT compare across TimeLines
|
603
|
+
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_time_line'>time_line</span><span class='period'>.</span><span class='id identifier rubyid_position_of'>position_of</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_meth'>meth</span><span class='comma'>,</span> <span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='period'>.</span><span class='id identifier rubyid_time_line'>time_line</span><span class='period'>.</span><span class='id identifier rubyid_position_of'>position_of</span><span class='lparen'>(</span><span class='id identifier rubyid_other_relative_time'>other_relative_time</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
604
|
+
<span class='rbrace'>}</span>
|
605
|
+
<span class='rbrace'>}</span></pre>
|
606
|
+
</td>
|
607
|
+
</tr>
|
608
|
+
</table>
|
609
|
+
</div>
|
405
610
|
|
406
|
-
|
611
|
+
<div class="method_details ">
|
612
|
+
<p class="signature " id="positioned?-instance_method">
|
613
|
+
|
614
|
+
- (<tt>Boolean</tt>) <strong>positioned?</strong>
|
407
615
|
|
408
616
|
|
409
|
-
|
617
|
+
|
618
|
+
</p><div class="docstring">
|
619
|
+
<div class="discussion">
|
620
|
+
|
621
|
+
<p>True if self has been properly placed on a TimeLine</p>
|
622
|
+
|
410
623
|
|
411
|
-
<div id="validator-badges">
|
412
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
413
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
414
|
-
Rdoc Generator</a> 2</small>.</p>
|
415
624
|
</div>
|
625
|
+
</div>
|
626
|
+
<div class="tags">
|
627
|
+
|
628
|
+
<h3>Returns:</h3>
|
629
|
+
<ul class="return">
|
630
|
+
|
631
|
+
<li>
|
632
|
+
|
633
|
+
|
634
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
—
|
639
|
+
<div class='inline'>
|
640
|
+
<p>true if self has been properly placed on a TimeLine</p>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
</li>
|
644
|
+
|
645
|
+
</ul>
|
646
|
+
|
647
|
+
</div><table class="source_code">
|
648
|
+
<tr>
|
649
|
+
<td>
|
650
|
+
<pre class="lines">
|
651
|
+
|
652
|
+
|
653
|
+
423
|
654
|
+
424
|
655
|
+
425</pre>
|
656
|
+
</td>
|
657
|
+
<td>
|
658
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 423</span>
|
659
|
+
|
660
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_positioned?'>positioned?</span>
|
661
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_time_line'>time_line</span> <span class='op'>&&</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_time_line'>time_line</span><span class='period'>.</span><span class='id identifier rubyid_indices_of'>indices_of</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
662
|
+
<span class='kw'>end</span></pre>
|
663
|
+
</td>
|
664
|
+
</tr>
|
665
|
+
</table>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div class="method_details ">
|
669
|
+
<p class="signature " id="to_s-instance_method">
|
670
|
+
|
671
|
+
- (<tt>String</tt>) <strong>to_s</strong>
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
</p><div class="docstring">
|
676
|
+
<div class="discussion">
|
677
|
+
|
678
|
+
<p>The string representation of referenced object</p>
|
416
679
|
|
417
|
-
</body>
|
418
|
-
</html>
|
419
680
|
|
681
|
+
</div>
|
682
|
+
</div>
|
683
|
+
<div class="tags">
|
684
|
+
|
685
|
+
<h3>Returns:</h3>
|
686
|
+
<ul class="return">
|
687
|
+
|
688
|
+
<li>
|
689
|
+
|
690
|
+
|
691
|
+
<span class='type'>(<tt>String</tt>)</span>
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
—
|
696
|
+
<div class='inline'>
|
697
|
+
<p>the string representation of referenced object</p>
|
698
|
+
</div>
|
699
|
+
|
700
|
+
</li>
|
701
|
+
|
702
|
+
</ul>
|
703
|
+
|
704
|
+
</div><table class="source_code">
|
705
|
+
<tr>
|
706
|
+
<td>
|
707
|
+
<pre class="lines">
|
708
|
+
|
709
|
+
|
710
|
+
407
|
711
|
+
408
|
712
|
+
409</pre>
|
713
|
+
</td>
|
714
|
+
<td>
|
715
|
+
<pre class="code"><span class="info file"># File 'lib/time_span.rb', line 407</span>
|
716
|
+
|
717
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
718
|
+
<span class='ivar'>@reference_to</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
719
|
+
<span class='kw'>end</span></pre>
|
720
|
+
</td>
|
721
|
+
</tr>
|
722
|
+
</table>
|
723
|
+
</div>
|
724
|
+
|
725
|
+
</div>
|
726
|
+
|
727
|
+
</div>
|
728
|
+
|
729
|
+
<div id="footer">
|
730
|
+
Generated on Fri Mar 2 13:34:26 2012 by
|
731
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
732
|
+
0.7.5 (ruby-1.9.3).
|
733
|
+
</div>
|
734
|
+
|
735
|
+
</body>
|
736
|
+
</html>
|