currency_spy 0.0.1 → 0.0.3

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.
@@ -0,0 +1,331 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: CurrencySpy::Walutomat</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="class">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="../index.html">Home</a>
29
+ <a href="../index.html#classes">Classes</a>
30
+ <a href="../index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="../lib/currency_spy/walutomat_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/currency_spy/walutomat.rb">lib/currency_spy/walutomat.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+ <div id="parent-class-section" class="section">
56
+ <h3 class="section-header">Parent</h3>
57
+
58
+ <p class="link"><a href="Scraper.html">CurrencySpy::Scraper</a></p>
59
+
60
+ </div>
61
+
62
+
63
+ <!-- Namespace Contents -->
64
+
65
+
66
+ <!-- Method Quickref -->
67
+
68
+ <div id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+ <ul class="link-list">
71
+
72
+ <li><a href="#method-c-new">::new</a></li>
73
+
74
+ <li><a href="#method-i-medium_rate">#medium_rate</a></li>
75
+
76
+ <li><a href="#method-i-rate_time">#rate_time</a></li>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+
82
+ <!-- Included Modules -->
83
+
84
+ </div>
85
+
86
+ <div id="project-metadata">
87
+
88
+
89
+ <div id="fileindex-section" class="section project-section">
90
+ <h3 class="section-header">Files</h3>
91
+ <ul>
92
+
93
+ <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
94
+
95
+ <li class="file"><a href="../LICENSE.html">LICENSE</a></li>
96
+
97
+ <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
98
+
99
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
100
+
101
+ <li class="file"><a href="../nbproject/private/rake-d_txt.html">rake-d.txt</a></li>
102
+
103
+ </ul>
104
+ </div>
105
+
106
+
107
+ <div id="classindex-section" class="section project-section">
108
+ <h3 class="section-header">Class Index
109
+ <span class="search-toggle"><img src="../images/find.png"
110
+ height="16" width="16" alt="[+]"
111
+ title="show/hide quicksearch" /></span></h3>
112
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
113
+ <fieldset>
114
+ <legend>Quicksearch</legend>
115
+ <input type="text" name="quicksearch" value=""
116
+ class="quicksearch-field" />
117
+ </fieldset>
118
+ </form>
119
+
120
+ <ul class="link-list">
121
+
122
+ <li><a href="../CurrencySpy.html">CurrencySpy</a></li>
123
+
124
+ <li><a href="../CurrencySpy/DnbNord.html">CurrencySpy::DnbNord</a></li>
125
+
126
+ <li><a href="../CurrencySpy/Nbp.html">CurrencySpy::Nbp</a></li>
127
+
128
+ <li><a href="../CurrencySpy/Scraper.html">CurrencySpy::Scraper</a></li>
129
+
130
+ <li><a href="../CurrencySpy/Walutomat.html">CurrencySpy::Walutomat</a></li>
131
+
132
+ </ul>
133
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
134
+ </div>
135
+
136
+
137
+ </div>
138
+ </div>
139
+
140
+ <div id="documentation">
141
+ <h1 class="class">CurrencySpy::Walutomat</h1>
142
+
143
+ <div id="description">
144
+ <p>
145
+ A class designed to fetch medium currency rates from Walutomat.pl a social
146
+ currency exchange platform.
147
+ </p>
148
+
149
+ </div>
150
+
151
+ <!-- Constants -->
152
+
153
+
154
+ <!-- Attributes -->
155
+
156
+
157
+ <!-- Methods -->
158
+
159
+ <div id="public-class-method-details" class="method-section section">
160
+ <h3 class="section-header">Public Class Methods</h3>
161
+
162
+
163
+ <div id="new-method" class="method-detail ">
164
+ <a name="method-c-new"></a>
165
+
166
+ <div class="method-heading">
167
+
168
+ <span class="method-name">new</span><span
169
+ class="method-args">()</span>
170
+ <span class="method-click-advice">click to toggle source</span>
171
+
172
+ </div>
173
+
174
+ <div class="method-description">
175
+
176
+ <p>
177
+ Constructor method. Initializes the following:
178
+ </p>
179
+ <ul>
180
+ <li><p>
181
+ a url of the source
182
+ </p>
183
+ </li>
184
+ <li><p>
185
+ and the name of the source
186
+ </p>
187
+ </li>
188
+ <li><p>
189
+ a list of currency codes available
190
+ </p>
191
+ </li>
192
+ </ul>
193
+
194
+
195
+
196
+ <div class="method-source-code"
197
+ id="new-source">
198
+ <pre>
199
+ <span class="ruby-comment cmt"># File lib/currency_spy/walutomat.rb, line 10</span>
200
+ 10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
201
+ 11: <span class="ruby-keyword kw">super</span>
202
+ 12: <span class="ruby-ivar">@url</span> = <span class="ruby-value str">'http://www.walutomat.pl/rates.php'</span>
203
+ 13: <span class="ruby-ivar">@institution</span> = <span class="ruby-value str">'Walutomat'</span>
204
+ 14: <span class="ruby-ivar">@available_codes</span> = <span class="ruby-node">%(EUR USD GBP CHF)</span>
205
+ 15: <span class="ruby-keyword kw">end</span></pre>
206
+ </div>
207
+
208
+ </div>
209
+
210
+
211
+
212
+
213
+ </div>
214
+
215
+
216
+ </div>
217
+
218
+ <div id="public-instance-method-details" class="method-section section">
219
+ <h3 class="section-header">Public Instance Methods</h3>
220
+
221
+
222
+ <div id="medium-rate-method" class="method-detail ">
223
+ <a name="method-i-medium_rate"></a>
224
+
225
+ <div class="method-heading">
226
+
227
+ <span class="method-name">medium_rate</span><span
228
+ class="method-args">()</span>
229
+ <span class="method-click-advice">click to toggle source</span>
230
+
231
+ </div>
232
+
233
+ <div class="method-description">
234
+
235
+ <p>
236
+ Fetch medium rate which is calculated based on current transactions in <a
237
+ href="Walutomat.html">Walutomat</a>
238
+ </p>
239
+
240
+
241
+
242
+ <div class="method-source-code"
243
+ id="medium-rate-source">
244
+ <pre>
245
+ <span class="ruby-comment cmt"># File lib/currency_spy/walutomat.rb, line 18</span>
246
+ 18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">medium_rate</span>
247
+ 19: <span class="ruby-identifier">regexp</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{currency_code} / PLN&quot;</span>)
248
+ 20: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">nil</span>
249
+ 21: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">search</span>(<span class="ruby-value str">&quot;//td[@name='pair']&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">td</span><span class="ruby-operator">|</span>
250
+ 22: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">regexp</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">td</span>.<span class="ruby-identifier">content</span>))
251
+ 23: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">td</span>.<span class="ruby-identifier">next_element</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">to_f</span>
252
+ 24: <span class="ruby-keyword kw">end</span>
253
+ 25: <span class="ruby-keyword kw">end</span>
254
+ 26: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">res</span>
255
+ 27: <span class="ruby-keyword kw">end</span></pre>
256
+ </div>
257
+
258
+ </div>
259
+
260
+
261
+
262
+
263
+ </div>
264
+
265
+
266
+ <div id="rate-time-method" class="method-detail ">
267
+ <a name="method-i-rate_time"></a>
268
+
269
+ <div class="method-heading">
270
+
271
+ <span class="method-name">rate_time</span><span
272
+ class="method-args">()</span>
273
+ <span class="method-click-advice">click to toggle source</span>
274
+
275
+ </div>
276
+
277
+ <div class="method-description">
278
+
279
+ <p>
280
+ The hour of the rate
281
+ </p>
282
+
283
+
284
+
285
+ <div class="method-source-code"
286
+ id="rate-time-source">
287
+ <pre>
288
+ <span class="ruby-comment cmt"># File lib/currency_spy/walutomat.rb, line 30</span>
289
+ 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rate_time</span>
290
+ 31: <span class="ruby-identifier">regexp</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">currency_code</span>)
291
+ 32: <span class="ruby-identifier">time_regexp</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-regexp re">/\d+:\d+/</span>)
292
+ 33: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">nil</span>
293
+ 34: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">search</span>(<span class="ruby-value str">&quot;//td[@name='pair']&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">td</span><span class="ruby-operator">|</span>
294
+ 35: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">regexp</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">td</span>.<span class="ruby-identifier">content</span>))
295
+ 36: <span class="ruby-identifier">hour</span> = <span class="ruby-identifier">td</span>.<span class="ruby-identifier">next_element</span>.<span class="ruby-identifier">next_element</span>.<span class="ruby-identifier">content</span>
296
+ 37: <span class="ruby-identifier">res</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">hour</span>)
297
+ 38: <span class="ruby-keyword kw">end</span>
298
+ 39: <span class="ruby-keyword kw">end</span>
299
+ 40: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">res</span>
300
+ 41: <span class="ruby-keyword kw">end</span></pre>
301
+ </div>
302
+
303
+ </div>
304
+
305
+
306
+
307
+
308
+ </div>
309
+
310
+
311
+ </div>
312
+
313
+
314
+ </div>
315
+
316
+
317
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
318
+
319
+ <p>Disabled; run with --debug to generate this.</p>
320
+
321
+ </div>
322
+
323
+ <div id="validator-badges">
324
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
325
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
326
+ Rdoc Generator</a> 1.1.6</small>.</p>
327
+ </div>
328
+
329
+ </body>
330
+ </html>
331
+
data/doc/Gemfile.html ADDED
@@ -0,0 +1,106 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: Gemfile [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="./js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="./js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="./js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="./index.html">Home</a>
29
+ <a href="./index.html#classes">Classes</a>
30
+ <a href="./index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
43
+
44
+ <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
45
+
46
+ <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
47
+
48
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
49
+
50
+ <li class="file"><a href="./nbproject/private/rake-d_txt.html">rake-d.txt</a></li>
51
+
52
+ </ul>
53
+ </div>
54
+
55
+
56
+ <div id="classindex-section" class="section project-section">
57
+ <h3 class="section-header">Class Index
58
+ <span class="search-toggle"><img src="./images/find.png"
59
+ height="16" width="16" alt="[+]"
60
+ title="show/hide quicksearch" /></span></h3>
61
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
62
+ <fieldset>
63
+ <legend>Quicksearch</legend>
64
+ <input type="text" name="quicksearch" value=""
65
+ class="quicksearch-field" />
66
+ </fieldset>
67
+ </form>
68
+
69
+ <ul class="link-list">
70
+
71
+ <li><a href="./CurrencySpy.html">CurrencySpy</a></li>
72
+
73
+ <li><a href="./CurrencySpy/DnbNord.html">CurrencySpy::DnbNord</a></li>
74
+
75
+ <li><a href="./CurrencySpy/Nbp.html">CurrencySpy::Nbp</a></li>
76
+
77
+ <li><a href="./CurrencySpy/Scraper.html">CurrencySpy::Scraper</a></li>
78
+
79
+ <li><a href="./CurrencySpy/Walutomat.html">CurrencySpy::Walutomat</a></li>
80
+
81
+ </ul>
82
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
83
+ </div>
84
+
85
+
86
+ </div>
87
+ </div>
88
+
89
+ <div id="documentation">
90
+ <p>
91
+ source &#8220;<a href="http://rubygems.org">rubygems.org</a>&#8220;
92
+ </p>
93
+ <p>
94
+ # Specify your gem&#8217;s dependencies in currency_spy.gemspec gemspec
95
+ </p>
96
+
97
+ </div>
98
+
99
+ <div id="validator-badges">
100
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
101
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
102
+ Rdoc Generator</a> 1.1.6</small>.</p>
103
+ </div>
104
+ </body>
105
+ </html>
106
+
data/doc/LICENSE.html ADDED
@@ -0,0 +1,125 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: LICENSE [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="./js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="./js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="./js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="./index.html">Home</a>
29
+ <a href="./index.html#classes">Classes</a>
30
+ <a href="./index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
43
+
44
+ <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
45
+
46
+ <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
47
+
48
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
49
+
50
+ <li class="file"><a href="./nbproject/private/rake-d_txt.html">rake-d.txt</a></li>
51
+
52
+ </ul>
53
+ </div>
54
+
55
+
56
+ <div id="classindex-section" class="section project-section">
57
+ <h3 class="section-header">Class Index
58
+ <span class="search-toggle"><img src="./images/find.png"
59
+ height="16" width="16" alt="[+]"
60
+ title="show/hide quicksearch" /></span></h3>
61
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
62
+ <fieldset>
63
+ <legend>Quicksearch</legend>
64
+ <input type="text" name="quicksearch" value=""
65
+ class="quicksearch-field" />
66
+ </fieldset>
67
+ </form>
68
+
69
+ <ul class="link-list">
70
+
71
+ <li><a href="./CurrencySpy.html">CurrencySpy</a></li>
72
+
73
+ <li><a href="./CurrencySpy/DnbNord.html">CurrencySpy::DnbNord</a></li>
74
+
75
+ <li><a href="./CurrencySpy/Nbp.html">CurrencySpy::Nbp</a></li>
76
+
77
+ <li><a href="./CurrencySpy/Scraper.html">CurrencySpy::Scraper</a></li>
78
+
79
+ <li><a href="./CurrencySpy/Walutomat.html">CurrencySpy::Walutomat</a></li>
80
+
81
+ </ul>
82
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
83
+ </div>
84
+
85
+
86
+ </div>
87
+ </div>
88
+
89
+ <div id="documentation">
90
+ <p>
91
+ Copyright &#169; 2011 Lukasz Badura
92
+ </p>
93
+ <p>
94
+ Permission is hereby granted, free of charge, to any person obtaining a
95
+ copy of this software and associated documentation files (the
96
+ &#8220;Software&#8221;), to deal in the Software without restriction,
97
+ including without limitation the rights to use, copy, modify, merge,
98
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
99
+ permit persons to whom the Software is furnished to do so, subject to the
100
+ following conditions:
101
+ </p>
102
+ <p>
103
+ The above copyright notice and this permission notice shall be included in
104
+ all copies or substantial portions of the Software.
105
+ </p>
106
+ <p>
107
+ THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND,
108
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
109
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
110
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
111
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
112
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
113
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
114
+ </p>
115
+
116
+ </div>
117
+
118
+ <div id="validator-badges">
119
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
120
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
121
+ Rdoc Generator</a> 1.1.6</small>.</p>
122
+ </div>
123
+ </body>
124
+ </html>
125
+