nanook 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/CHANGELOG.md +26 -0
  4. data/Gemfile.lock +2 -2
  5. data/README.md +18 -7
  6. data/Rakefile +18 -0
  7. data/docs/0.7.0/apple-touch-icon.png +0 -0
  8. data/docs/0.7.0/classes/Nanook.html +572 -0
  9. data/docs/0.7.0/classes/Nanook/Account.html +909 -0
  10. data/docs/0.7.0/classes/Nanook/Block.html +717 -0
  11. data/docs/0.7.0/classes/Nanook/Error.html +84 -0
  12. data/docs/0.7.0/classes/Nanook/Key.html +253 -0
  13. data/docs/0.7.0/classes/Nanook/Node.html +657 -0
  14. data/docs/0.7.0/classes/Nanook/Rpc.html +247 -0
  15. data/docs/0.7.0/classes/Nanook/Util.html +197 -0
  16. data/docs/0.7.0/classes/Nanook/Wallet.html +986 -0
  17. data/docs/0.7.0/classes/Nanook/WalletAccount.html +446 -0
  18. data/docs/0.7.0/classes/Nanook/WorkPeer.html +294 -0
  19. data/docs/0.7.0/created.rid +14 -0
  20. data/docs/0.7.0/css/github.css +123 -0
  21. data/docs/0.7.0/css/main.css +374 -0
  22. data/docs/0.7.0/css/panel.css +360 -0
  23. data/docs/0.7.0/css/reset.css +48 -0
  24. data/docs/0.7.0/favicon.ico +0 -0
  25. data/docs/0.7.0/files/README_md.html +418 -0
  26. data/docs/0.7.0/files/lib/nanook/account_rb.html +89 -0
  27. data/docs/0.7.0/files/lib/nanook/block_rb.html +89 -0
  28. data/docs/0.7.0/files/lib/nanook/error_rb.html +89 -0
  29. data/docs/0.7.0/files/lib/nanook/key_rb.html +89 -0
  30. data/docs/0.7.0/files/lib/nanook/node_rb.html +89 -0
  31. data/docs/0.7.0/files/lib/nanook/rpc_rb.html +99 -0
  32. data/docs/0.7.0/files/lib/nanook/util_rb.html +89 -0
  33. data/docs/0.7.0/files/lib/nanook/version_rb.html +84 -0
  34. data/docs/0.7.0/files/lib/nanook/wallet_account_rb.html +89 -0
  35. data/docs/0.7.0/files/lib/nanook/wallet_rb.html +89 -0
  36. data/docs/0.7.0/files/lib/nanook/work_peer_rb.html +89 -0
  37. data/docs/0.7.0/files/lib/nanook_rb.html +94 -0
  38. data/docs/0.7.0/i/arrow-down.svg +8 -0
  39. data/docs/0.7.0/i/arrow-right.svg +8 -0
  40. data/docs/0.7.0/i/search.svg +12 -0
  41. data/docs/0.7.0/i/tree_bg.svg +8 -0
  42. data/docs/0.7.0/index.html +11 -0
  43. data/docs/0.7.0/js/highlight.pack.js +1 -0
  44. data/docs/0.7.0/js/jquery-1.3.2.min.js +19 -0
  45. data/docs/0.7.0/js/main.js +25 -0
  46. data/docs/0.7.0/js/navigation.js +142 -0
  47. data/docs/0.7.0/js/search_index.js +1 -0
  48. data/docs/0.7.0/js/searchdoc.js +465 -0
  49. data/docs/0.7.0/js/searcher.js +229 -0
  50. data/docs/0.7.0/panel/index.html +47 -0
  51. data/docs/0.7.0/panel/links.html +32 -0
  52. data/docs/0.7.0/panel/tree.js +1 -0
  53. data/docs/0.8.0/apple-touch-icon.png +0 -0
  54. data/docs/0.8.0/classes/Nanook.html +621 -0
  55. data/docs/0.8.0/classes/Nanook/Account.html +971 -0
  56. data/docs/0.8.0/classes/Nanook/Block.html +759 -0
  57. data/docs/0.8.0/classes/Nanook/Error.html +84 -0
  58. data/docs/0.8.0/classes/Nanook/Key.html +295 -0
  59. data/docs/0.8.0/classes/Nanook/Node.html +657 -0
  60. data/docs/0.8.0/classes/Nanook/Rpc.html +247 -0
  61. data/docs/0.8.0/classes/Nanook/Util.html +264 -0
  62. data/docs/0.8.0/classes/Nanook/Wallet.html +1056 -0
  63. data/docs/0.8.0/classes/Nanook/WalletAccount.html +582 -0
  64. data/docs/0.8.0/classes/Nanook/WorkPeer.html +294 -0
  65. data/docs/0.8.0/created.rid +14 -0
  66. data/docs/0.8.0/css/github.css +123 -0
  67. data/docs/0.8.0/css/main.css +374 -0
  68. data/docs/0.8.0/css/panel.css +360 -0
  69. data/docs/0.8.0/css/reset.css +48 -0
  70. data/docs/0.8.0/favicon.ico +0 -0
  71. data/docs/0.8.0/files/README_md.html +423 -0
  72. data/docs/0.8.0/files/lib/nanook/account_rb.html +89 -0
  73. data/docs/0.8.0/files/lib/nanook/block_rb.html +89 -0
  74. data/docs/0.8.0/files/lib/nanook/error_rb.html +89 -0
  75. data/docs/0.8.0/files/lib/nanook/key_rb.html +89 -0
  76. data/docs/0.8.0/files/lib/nanook/node_rb.html +89 -0
  77. data/docs/0.8.0/files/lib/nanook/rpc_rb.html +99 -0
  78. data/docs/0.8.0/files/lib/nanook/util_rb.html +97 -0
  79. data/docs/0.8.0/files/lib/nanook/version_rb.html +84 -0
  80. data/docs/0.8.0/files/lib/nanook/wallet_account_rb.html +89 -0
  81. data/docs/0.8.0/files/lib/nanook/wallet_rb.html +89 -0
  82. data/docs/0.8.0/files/lib/nanook/work_peer_rb.html +89 -0
  83. data/docs/0.8.0/files/lib/nanook_rb.html +94 -0
  84. data/docs/0.8.0/i/arrow-down.svg +8 -0
  85. data/docs/0.8.0/i/arrow-right.svg +8 -0
  86. data/docs/0.8.0/i/search.svg +12 -0
  87. data/docs/0.8.0/i/tree_bg.svg +8 -0
  88. data/docs/0.8.0/index.html +11 -0
  89. data/docs/0.8.0/js/highlight.pack.js +1 -0
  90. data/docs/0.8.0/js/jquery-1.3.2.min.js +19 -0
  91. data/docs/0.8.0/js/main.js +25 -0
  92. data/docs/0.8.0/js/navigation.js +142 -0
  93. data/docs/0.8.0/js/search_index.js +1 -0
  94. data/docs/0.8.0/js/searchdoc.js +465 -0
  95. data/docs/0.8.0/js/searcher.js +229 -0
  96. data/docs/0.8.0/panel/index.html +47 -0
  97. data/docs/0.8.0/panel/links.html +32 -0
  98. data/docs/0.8.0/panel/tree.js +1 -0
  99. data/docs/1.0.0/apple-touch-icon.png +0 -0
  100. data/docs/1.0.0/classes/Nanook.html +621 -0
  101. data/docs/1.0.0/classes/Nanook/Account.html +971 -0
  102. data/docs/1.0.0/classes/Nanook/Block.html +759 -0
  103. data/docs/1.0.0/classes/Nanook/Error.html +84 -0
  104. data/docs/1.0.0/classes/Nanook/Key.html +295 -0
  105. data/docs/1.0.0/classes/Nanook/Node.html +657 -0
  106. data/docs/1.0.0/classes/Nanook/Rpc.html +247 -0
  107. data/docs/1.0.0/classes/Nanook/Util.html +264 -0
  108. data/docs/1.0.0/classes/Nanook/Wallet.html +1056 -0
  109. data/docs/1.0.0/classes/Nanook/WalletAccount.html +582 -0
  110. data/docs/1.0.0/classes/Nanook/WorkPeer.html +294 -0
  111. data/docs/1.0.0/created.rid +14 -0
  112. data/docs/1.0.0/css/github.css +123 -0
  113. data/docs/1.0.0/css/main.css +374 -0
  114. data/docs/1.0.0/css/panel.css +360 -0
  115. data/docs/1.0.0/css/reset.css +48 -0
  116. data/docs/1.0.0/favicon.ico +0 -0
  117. data/docs/1.0.0/files/README_md.html +423 -0
  118. data/docs/1.0.0/files/lib/nanook/account_rb.html +89 -0
  119. data/docs/1.0.0/files/lib/nanook/block_rb.html +89 -0
  120. data/docs/1.0.0/files/lib/nanook/error_rb.html +89 -0
  121. data/docs/1.0.0/files/lib/nanook/key_rb.html +89 -0
  122. data/docs/1.0.0/files/lib/nanook/node_rb.html +89 -0
  123. data/docs/1.0.0/files/lib/nanook/rpc_rb.html +99 -0
  124. data/docs/1.0.0/files/lib/nanook/util_rb.html +97 -0
  125. data/docs/1.0.0/files/lib/nanook/version_rb.html +84 -0
  126. data/docs/1.0.0/files/lib/nanook/wallet_account_rb.html +89 -0
  127. data/docs/1.0.0/files/lib/nanook/wallet_rb.html +89 -0
  128. data/docs/1.0.0/files/lib/nanook/work_peer_rb.html +89 -0
  129. data/docs/1.0.0/files/lib/nanook_rb.html +94 -0
  130. data/docs/1.0.0/i/arrow-down.svg +8 -0
  131. data/docs/1.0.0/i/arrow-right.svg +8 -0
  132. data/docs/1.0.0/i/search.svg +12 -0
  133. data/docs/1.0.0/i/tree_bg.svg +8 -0
  134. data/docs/1.0.0/index.html +11 -0
  135. data/docs/1.0.0/js/highlight.pack.js +1 -0
  136. data/docs/1.0.0/js/jquery-1.3.2.min.js +19 -0
  137. data/docs/1.0.0/js/main.js +25 -0
  138. data/docs/1.0.0/js/navigation.js +142 -0
  139. data/docs/1.0.0/js/search_index.js +1 -0
  140. data/docs/1.0.0/js/searchdoc.js +465 -0
  141. data/docs/1.0.0/js/searcher.js +229 -0
  142. data/docs/1.0.0/panel/index.html +47 -0
  143. data/docs/1.0.0/panel/links.html +32 -0
  144. data/docs/1.0.0/panel/tree.js +1 -0
  145. data/docs/apple-touch-icon.png +0 -0
  146. data/docs/classes/Nanook.html +572 -0
  147. data/docs/classes/Nanook/Account.html +907 -0
  148. data/docs/classes/Nanook/Block.html +717 -0
  149. data/docs/classes/Nanook/Error.html +84 -0
  150. data/docs/classes/Nanook/Key.html +253 -0
  151. data/docs/classes/Nanook/Node.html +657 -0
  152. data/docs/classes/Nanook/Rpc.html +247 -0
  153. data/docs/classes/Nanook/Util.html +197 -0
  154. data/docs/classes/Nanook/Wallet.html +778 -0
  155. data/docs/classes/Nanook/WalletAccount.html +447 -0
  156. data/docs/classes/Nanook/WorkPeer.html +294 -0
  157. data/docs/created.rid +14 -0
  158. data/docs/css/github.css +123 -0
  159. data/docs/css/main.css +374 -0
  160. data/docs/css/panel.css +360 -0
  161. data/docs/css/reset.css +48 -0
  162. data/docs/favicon.ico +0 -0
  163. data/docs/files/README_md.html +408 -0
  164. data/docs/files/lib/nanook/account_rb.html +89 -0
  165. data/docs/files/lib/nanook/block_rb.html +89 -0
  166. data/docs/files/lib/nanook/error_rb.html +89 -0
  167. data/docs/files/lib/nanook/key_rb.html +89 -0
  168. data/docs/files/lib/nanook/node_rb.html +89 -0
  169. data/docs/files/lib/nanook/rpc_rb.html +99 -0
  170. data/docs/files/lib/nanook/util_rb.html +89 -0
  171. data/docs/files/lib/nanook/version_rb.html +84 -0
  172. data/docs/files/lib/nanook/wallet_account_rb.html +89 -0
  173. data/docs/files/lib/nanook/wallet_rb.html +89 -0
  174. data/docs/files/lib/nanook/work_peer_rb.html +89 -0
  175. data/docs/files/lib/nanook_rb.html +94 -0
  176. data/docs/i/arrow-down.svg +8 -0
  177. data/docs/i/arrow-right.svg +8 -0
  178. data/docs/i/search.svg +12 -0
  179. data/docs/i/tree_bg.svg +8 -0
  180. data/docs/index.html +11 -0
  181. data/docs/js/highlight.pack.js +1 -0
  182. data/docs/js/jquery-1.3.2.min.js +19 -0
  183. data/docs/js/main.js +25 -0
  184. data/docs/js/navigation.js +142 -0
  185. data/docs/js/search_index.js +1 -0
  186. data/docs/js/searchdoc.js +465 -0
  187. data/docs/js/searcher.js +229 -0
  188. data/docs/panel/index.html +47 -0
  189. data/docs/panel/links.html +32 -0
  190. data/docs/panel/tree.js +1 -0
  191. data/lib/nanook.rb +40 -4
  192. data/lib/nanook/account.rb +250 -8
  193. data/lib/nanook/block.rb +25 -2
  194. data/lib/nanook/key.rb +10 -2
  195. data/lib/nanook/node.rb +4 -0
  196. data/lib/nanook/rpc.rb +5 -1
  197. data/lib/nanook/util.rb +9 -1
  198. data/lib/nanook/version.rb +1 -1
  199. data/lib/nanook/wallet.rb +275 -14
  200. data/lib/nanook/wallet_account.rb +63 -11
  201. data/lib/nanook/work_peer.rb +4 -0
  202. metadata +188 -3
@@ -0,0 +1,447 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Nanook::WalletAccount</title>
5
+ <meta charset="UTF-8" />
6
+ <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
7
+ <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
8
+ <link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
9
+ <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
12
+
13
+
14
+ <meta property="og:title" value="Nanook::WalletAccount">
15
+
16
+
17
+
18
+ <meta name="keywords" content="Nanook::WalletAccount class">
19
+
20
+ <meta name="keywords" content="new, create, destroy, pay, receive, method_missing">
21
+
22
+ </head>
23
+
24
+ <body>
25
+ <div class="banner">
26
+
27
+ <h1>
28
+ <span class="type">Class</span>
29
+ Nanook::WalletAccount
30
+
31
+ <span class="parent">&lt;
32
+
33
+ Object
34
+
35
+ </span>
36
+
37
+ </h1>
38
+ <ul class="files">
39
+
40
+ <li><a href="../../files/lib/nanook/wallet_account_rb.html">lib/nanook/wallet_account.rb</a></li>
41
+
42
+ </ul>
43
+ </div>
44
+ <div id="bodyContent">
45
+ <div id="content">
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ <!-- Method ref -->
61
+ <div class="sectiontitle">Methods</div>
62
+ <dl class="methods">
63
+
64
+ <dt>C</dt>
65
+ <dd>
66
+ <ul>
67
+
68
+
69
+ <li>
70
+ <a href="#method-i-create">create</a>
71
+ </li>
72
+
73
+ </ul>
74
+ </dd>
75
+
76
+ <dt>D</dt>
77
+ <dd>
78
+ <ul>
79
+
80
+
81
+ <li>
82
+ <a href="#method-i-destroy">destroy</a>
83
+ </li>
84
+
85
+ </ul>
86
+ </dd>
87
+
88
+ <dt>M</dt>
89
+ <dd>
90
+ <ul>
91
+
92
+
93
+ <li>
94
+ <a href="#method-i-method_missing">method_missing</a>
95
+ </li>
96
+
97
+ </ul>
98
+ </dd>
99
+
100
+ <dt>N</dt>
101
+ <dd>
102
+ <ul>
103
+
104
+
105
+ <li>
106
+ <a href="#method-c-new">new</a>
107
+ </li>
108
+
109
+ </ul>
110
+ </dd>
111
+
112
+ <dt>P</dt>
113
+ <dd>
114
+ <ul>
115
+
116
+
117
+ <li>
118
+ <a href="#method-i-pay">pay</a>
119
+ </li>
120
+
121
+ </ul>
122
+ </dd>
123
+
124
+ <dt>R</dt>
125
+ <dd>
126
+ <ul>
127
+
128
+
129
+ <li>
130
+ <a href="#method-i-receive">receive</a>
131
+ </li>
132
+
133
+ </ul>
134
+ </dd>
135
+
136
+ </dl>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ <!-- Methods -->
156
+
157
+ <div class="sectiontitle">Class Public methods</div>
158
+
159
+ <div class="method">
160
+ <div class="title method-title" id="method-c-new">
161
+
162
+ <b>new</b>(rpc, wallet, account)
163
+
164
+ <a href="../../classes/Nanook/WalletAccount.html#method-c-new" name="method-c-new" class="permalink">Link</a>
165
+ </div>
166
+
167
+
168
+ <div class="description">
169
+
170
+ </div>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ <div class="sourcecode">
180
+
181
+ <p class="source-link">
182
+ Source:
183
+ <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
184
+
185
+ </p>
186
+ <div id="method-c-new_source" class="dyn-source">
187
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 4</span>
188
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">rpc</span>, <span class="ruby-identifier">wallet</span>, <span class="ruby-identifier">account</span>)
189
+ <span class="ruby-ivar">@rpc</span> = <span class="ruby-identifier">rpc</span>
190
+ <span class="ruby-ivar">@wallet</span> = <span class="ruby-identifier">wallet</span>
191
+ <span class="ruby-ivar">@account</span> = <span class="ruby-identifier">account</span>
192
+
193
+ <span class="ruby-comment"># An object to delegate account methods that don&#39;t</span>
194
+ <span class="ruby-comment"># expect a wallet param in the RPC call, to allow this</span>
195
+ <span class="ruby-comment"># class to support all methods that can be called on Nanook::Account</span>
196
+ <span class="ruby-ivar">@nanook_account_instance</span> = <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Account</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rpc</span>, <span class="ruby-ivar">@account</span>)
197
+
198
+ <span class="ruby-comment"># Wallet instance to call contains? on to check account</span>
199
+ <span class="ruby-comment"># is in wallet</span>
200
+ <span class="ruby-ivar">@nanook_wallet_instance</span> = <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Wallet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rpc</span>, <span class="ruby-ivar">@wallet</span>)
201
+
202
+ <span class="ruby-ivar">@known_valid_accounts</span> = []
203
+ <span class="ruby-keyword">end</span></pre>
204
+ </div>
205
+ </div>
206
+
207
+ </div>
208
+
209
+
210
+
211
+ <div class="sectiontitle">Instance Public methods</div>
212
+
213
+ <div class="method">
214
+ <div class="title method-title" id="method-i-create">
215
+
216
+ <b>create</b>()
217
+
218
+ <a href="../../classes/Nanook/WalletAccount.html#method-i-create" name="method-i-create" class="permalink">Link</a>
219
+ </div>
220
+
221
+
222
+ <div class="description">
223
+
224
+ </div>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ <div class="sourcecode">
234
+
235
+ <p class="source-link">
236
+ Source:
237
+ <a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
238
+
239
+ </p>
240
+ <div id="method-i-create_source" class="dyn-source">
241
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 21</span>
242
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>
243
+ <span class="ruby-identifier">wallet_required!</span>
244
+ <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:account_create</span>)[<span class="ruby-value">:account</span>]
245
+ <span class="ruby-keyword">end</span></pre>
246
+ </div>
247
+ </div>
248
+
249
+ </div>
250
+
251
+ <div class="method">
252
+ <div class="title method-title" id="method-i-destroy">
253
+
254
+ <b>destroy</b>()
255
+
256
+ <a href="../../classes/Nanook/WalletAccount.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
257
+ </div>
258
+
259
+
260
+ <div class="description">
261
+
262
+ </div>
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <div class="sourcecode">
272
+
273
+ <p class="source-link">
274
+ Source:
275
+ <a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
276
+
277
+ </p>
278
+ <div id="method-i-destroy_source" class="dyn-source">
279
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 26</span>
280
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">destroy</span>
281
+ <span class="ruby-identifier">wallet_required!</span>
282
+ <span class="ruby-identifier">account_must_belong_to_wallet!</span>
283
+ (<span class="ruby-identifier">rpc</span>(<span class="ruby-value">:account_remove</span>)[<span class="ruby-value">:removed</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">tap</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">success</span><span class="ruby-operator">|</span>
284
+ <span class="ruby-ivar">@known_valid_accounts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-ivar">@account</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">success</span>
285
+ <span class="ruby-keyword">end</span>
286
+ <span class="ruby-keyword">end</span></pre>
287
+ </div>
288
+ </div>
289
+
290
+ </div>
291
+
292
+ <div class="method">
293
+ <div class="title method-title" id="method-i-method_missing">
294
+
295
+ <b>method_missing</b>(m, *args, &amp;block)
296
+
297
+ <a href="../../classes/Nanook/WalletAccount.html#method-i-method_missing" name="method-i-method_missing" class="permalink">Link</a>
298
+ </div>
299
+
300
+
301
+ <div class="description">
302
+ <p>Any method of <a href="Account.html">Nanook::Account</a> can be called on
303
+ this class too</p>
304
+ </div>
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+ <div class="sourcecode">
314
+
315
+ <p class="source-link">
316
+ Source:
317
+ <a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
318
+
319
+ </p>
320
+ <div id="method-i-method_missing_source" class="dyn-source">
321
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 76</span>
322
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">method_missing</span>(<span class="ruby-identifier">m</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
323
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@nanook_account_instance</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">m</span>)
324
+ <span class="ruby-ivar">@nanook_account_instance</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">m</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
325
+ <span class="ruby-keyword">else</span>
326
+ <span class="ruby-keyword">super</span>(<span class="ruby-identifier">m</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
327
+ <span class="ruby-keyword">end</span>
328
+ <span class="ruby-keyword">end</span></pre>
329
+ </div>
330
+ </div>
331
+
332
+ </div>
333
+
334
+ <div class="method">
335
+ <div class="title method-title" id="method-i-pay">
336
+
337
+ <b>pay</b>(to:, amount:, id:)
338
+
339
+ <a href="../../classes/Nanook/WalletAccount.html#method-i-pay" name="method-i-pay" class="permalink">Link</a>
340
+ </div>
341
+
342
+
343
+ <div class="description">
344
+
345
+ </div>
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+ <div class="sourcecode">
355
+
356
+ <p class="source-link">
357
+ Source:
358
+ <a href="javascript:toggleSource('method-i-pay_source')" id="l_method-i-pay_source">show</a>
359
+
360
+ </p>
361
+ <div id="method-i-pay_source" class="dyn-source">
362
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 34</span>
363
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pay</span>(<span class="ruby-value">to:</span>, <span class="ruby-value">amount:</span>, <span class="ruby-value">id:</span>)
364
+ <span class="ruby-identifier">wallet_required!</span>
365
+ <span class="ruby-identifier">account_must_belong_to_wallet!</span>
366
+
367
+ <span class="ruby-comment"># Check that to: account is valid</span>
368
+ <span class="ruby-keyword">unless</span> <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Account</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rpc</span>, <span class="ruby-identifier">to</span>).<span class="ruby-identifier">exists?</span>
369
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;To account does not exist (#{to})&quot;</span>)
370
+ <span class="ruby-keyword">end</span>
371
+
372
+ <span class="ruby-identifier">raw</span> = <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-constant">NANO_to_raw</span>(<span class="ruby-identifier">amount</span>)
373
+
374
+ <span class="ruby-comment"># account is called source, so don&#39;t use the normal rpc method</span>
375
+ <span class="ruby-identifier">p</span> = {
376
+ <span class="ruby-value">wallet:</span> <span class="ruby-ivar">@wallet</span>,
377
+ <span class="ruby-value">source:</span> <span class="ruby-ivar">@account</span>,
378
+ <span class="ruby-value">destination:</span> <span class="ruby-identifier">to</span>,
379
+ <span class="ruby-value">amount:</span> <span class="ruby-identifier">raw</span>,
380
+ <span class="ruby-value">id:</span> <span class="ruby-identifier">id</span>
381
+ }
382
+
383
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@rpc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-value">:send</span>, <span class="ruby-identifier">p</span>)
384
+
385
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:error</span>]
386
+ <span class="ruby-identifier">response</span>
387
+ <span class="ruby-keyword">else</span>
388
+ <span class="ruby-identifier">response</span>[<span class="ruby-value">:block</span>]
389
+ <span class="ruby-keyword">end</span>
390
+ <span class="ruby-keyword">end</span></pre>
391
+ </div>
392
+ </div>
393
+
394
+ </div>
395
+
396
+ <div class="method">
397
+ <div class="title method-title" id="method-i-receive">
398
+
399
+ <b>receive</b>(block=nil)
400
+
401
+ <a href="../../classes/Nanook/WalletAccount.html#method-i-receive" name="method-i-receive" class="permalink">Link</a>
402
+ </div>
403
+
404
+
405
+ <div class="description">
406
+ <p>Returns false if no block to receive</p>
407
+ </div>
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+ <div class="sourcecode">
417
+
418
+ <p class="source-link">
419
+ Source:
420
+ <a href="javascript:toggleSource('method-i-receive_source')" id="l_method-i-receive_source">show</a>
421
+
422
+ </p>
423
+ <div id="method-i-receive_source" class="dyn-source">
424
+ <pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 64</span>
425
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">receive</span>(<span class="ruby-identifier">block</span>=<span class="ruby-keyword">nil</span>)
426
+ <span class="ruby-identifier">wallet_required!</span>
427
+ <span class="ruby-identifier">account_must_belong_to_wallet!</span>
428
+
429
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
430
+ <span class="ruby-identifier">_receive_without_block</span>
431
+ <span class="ruby-keyword">else</span>
432
+ <span class="ruby-identifier">_receive_with_block</span>(<span class="ruby-identifier">block</span>)
433
+ <span class="ruby-keyword">end</span>
434
+ <span class="ruby-keyword">end</span></pre>
435
+ </div>
436
+ </div>
437
+
438
+ </div>
439
+
440
+
441
+
442
+
443
+ </div>
444
+
445
+ </div>
446
+ </body>
447
+ </html>
@@ -0,0 +1,294 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Nanook::WorkPeer</title>
5
+ <meta charset="UTF-8" />
6
+ <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
7
+ <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
8
+ <link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
9
+ <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
12
+
13
+
14
+ <meta property="og:title" value="Nanook::WorkPeer">
15
+
16
+
17
+
18
+ <meta name="keywords" content="Nanook::WorkPeer class">
19
+
20
+ <meta name="keywords" content="new, add, clear, list">
21
+
22
+ </head>
23
+
24
+ <body>
25
+ <div class="banner">
26
+
27
+ <h1>
28
+ <span class="type">Class</span>
29
+ Nanook::WorkPeer
30
+
31
+ <span class="parent">&lt;
32
+
33
+ Object
34
+
35
+ </span>
36
+
37
+ </h1>
38
+ <ul class="files">
39
+
40
+ <li><a href="../../files/lib/nanook/work_peer_rb.html">lib/nanook/work_peer.rb</a></li>
41
+
42
+ </ul>
43
+ </div>
44
+ <div id="bodyContent">
45
+ <div id="content">
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ <!-- Method ref -->
61
+ <div class="sectiontitle">Methods</div>
62
+ <dl class="methods">
63
+
64
+ <dt>A</dt>
65
+ <dd>
66
+ <ul>
67
+
68
+
69
+ <li>
70
+ <a href="#method-i-add">add</a>
71
+ </li>
72
+
73
+ </ul>
74
+ </dd>
75
+
76
+ <dt>C</dt>
77
+ <dd>
78
+ <ul>
79
+
80
+
81
+ <li>
82
+ <a href="#method-i-clear">clear</a>
83
+ </li>
84
+
85
+ </ul>
86
+ </dd>
87
+
88
+ <dt>L</dt>
89
+ <dd>
90
+ <ul>
91
+
92
+
93
+ <li>
94
+ <a href="#method-i-list">list</a>
95
+ </li>
96
+
97
+ </ul>
98
+ </dd>
99
+
100
+ <dt>N</dt>
101
+ <dd>
102
+ <ul>
103
+
104
+
105
+ <li>
106
+ <a href="#method-c-new">new</a>
107
+ </li>
108
+
109
+ </ul>
110
+ </dd>
111
+
112
+ </dl>
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <!-- Methods -->
132
+
133
+ <div class="sectiontitle">Class Public methods</div>
134
+
135
+ <div class="method">
136
+ <div class="title method-title" id="method-c-new">
137
+
138
+ <b>new</b>(rpc)
139
+
140
+ <a href="../../classes/Nanook/WorkPeer.html#method-c-new" name="method-c-new" class="permalink">Link</a>
141
+ </div>
142
+
143
+
144
+ <div class="description">
145
+
146
+ </div>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ <div class="sourcecode">
156
+
157
+ <p class="source-link">
158
+ Source:
159
+ <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
160
+
161
+ </p>
162
+ <div id="method-c-new_source" class="dyn-source">
163
+ <pre><span class="ruby-comment"># File lib/nanook/work_peer.rb, line 4</span>
164
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">rpc</span>)
165
+ <span class="ruby-ivar">@rpc</span> = <span class="ruby-identifier">rpc</span>
166
+ <span class="ruby-keyword">end</span></pre>
167
+ </div>
168
+ </div>
169
+
170
+ </div>
171
+
172
+
173
+
174
+ <div class="sectiontitle">Instance Public methods</div>
175
+
176
+ <div class="method">
177
+ <div class="title method-title" id="method-i-add">
178
+
179
+ <b>add</b>(address:, port:)
180
+
181
+ <a href="../../classes/Nanook/WorkPeer.html#method-i-add" name="method-i-add" class="permalink">Link</a>
182
+ </div>
183
+
184
+
185
+ <div class="description">
186
+
187
+ </div>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+ <div class="sourcecode">
197
+
198
+ <p class="source-link">
199
+ Source:
200
+ <a href="javascript:toggleSource('method-i-add_source')" id="l_method-i-add_source">show</a>
201
+
202
+ </p>
203
+ <div id="method-i-add_source" class="dyn-source">
204
+ <pre><span class="ruby-comment"># File lib/nanook/work_peer.rb, line 8</span>
205
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add</span>(<span class="ruby-value">address:</span>, <span class="ruby-value">port:</span>)
206
+ <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_peer_add</span>, <span class="ruby-value">address:</span> <span class="ruby-identifier">address</span>, <span class="ruby-value">port:</span> <span class="ruby-identifier">port</span>).<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:success</span>)
207
+ <span class="ruby-keyword">end</span></pre>
208
+ </div>
209
+ </div>
210
+
211
+ </div>
212
+
213
+ <div class="method">
214
+ <div class="title method-title" id="method-i-clear">
215
+
216
+ <b>clear</b>()
217
+
218
+ <a href="../../classes/Nanook/WorkPeer.html#method-i-clear" name="method-i-clear" class="permalink">Link</a>
219
+ </div>
220
+
221
+
222
+ <div class="description">
223
+
224
+ </div>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ <div class="sourcecode">
234
+
235
+ <p class="source-link">
236
+ Source:
237
+ <a href="javascript:toggleSource('method-i-clear_source')" id="l_method-i-clear_source">show</a>
238
+
239
+ </p>
240
+ <div id="method-i-clear_source" class="dyn-source">
241
+ <pre><span class="ruby-comment"># File lib/nanook/work_peer.rb, line 12</span>
242
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear</span>
243
+ <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_peers_clear</span>).<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:success</span>)
244
+ <span class="ruby-keyword">end</span></pre>
245
+ </div>
246
+ </div>
247
+
248
+ </div>
249
+
250
+ <div class="method">
251
+ <div class="title method-title" id="method-i-list">
252
+
253
+ <b>list</b>()
254
+
255
+ <a href="../../classes/Nanook/WorkPeer.html#method-i-list" name="method-i-list" class="permalink">Link</a>
256
+ </div>
257
+
258
+
259
+ <div class="description">
260
+
261
+ </div>
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ <div class="sourcecode">
271
+
272
+ <p class="source-link">
273
+ Source:
274
+ <a href="javascript:toggleSource('method-i-list_source')" id="l_method-i-list_source">show</a>
275
+
276
+ </p>
277
+ <div id="method-i-list_source" class="dyn-source">
278
+ <pre><span class="ruby-comment"># File lib/nanook/work_peer.rb, line 16</span>
279
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">list</span>
280
+ <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_peers</span>)[<span class="ruby-value">:work_peers</span>]
281
+ <span class="ruby-keyword">end</span></pre>
282
+ </div>
283
+ </div>
284
+
285
+ </div>
286
+
287
+
288
+
289
+
290
+ </div>
291
+
292
+ </div>
293
+ </body>
294
+ </html>