nanook 0.7.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CHANGELOG.md +26 -0
- data/Gemfile.lock +2 -2
- data/README.md +18 -7
- data/Rakefile +18 -0
- data/docs/0.7.0/apple-touch-icon.png +0 -0
- data/docs/0.7.0/classes/Nanook.html +572 -0
- data/docs/0.7.0/classes/Nanook/Account.html +909 -0
- data/docs/0.7.0/classes/Nanook/Block.html +717 -0
- data/docs/0.7.0/classes/Nanook/Error.html +84 -0
- data/docs/0.7.0/classes/Nanook/Key.html +253 -0
- data/docs/0.7.0/classes/Nanook/Node.html +657 -0
- data/docs/0.7.0/classes/Nanook/Rpc.html +247 -0
- data/docs/0.7.0/classes/Nanook/Util.html +197 -0
- data/docs/0.7.0/classes/Nanook/Wallet.html +986 -0
- data/docs/0.7.0/classes/Nanook/WalletAccount.html +446 -0
- data/docs/0.7.0/classes/Nanook/WorkPeer.html +294 -0
- data/docs/0.7.0/created.rid +14 -0
- data/docs/0.7.0/css/github.css +123 -0
- data/docs/0.7.0/css/main.css +374 -0
- data/docs/0.7.0/css/panel.css +360 -0
- data/docs/0.7.0/css/reset.css +48 -0
- data/docs/0.7.0/favicon.ico +0 -0
- data/docs/0.7.0/files/README_md.html +418 -0
- data/docs/0.7.0/files/lib/nanook/account_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/block_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/error_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/key_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/node_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/rpc_rb.html +99 -0
- data/docs/0.7.0/files/lib/nanook/util_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/version_rb.html +84 -0
- data/docs/0.7.0/files/lib/nanook/wallet_account_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/wallet_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook/work_peer_rb.html +89 -0
- data/docs/0.7.0/files/lib/nanook_rb.html +94 -0
- data/docs/0.7.0/i/arrow-down.svg +8 -0
- data/docs/0.7.0/i/arrow-right.svg +8 -0
- data/docs/0.7.0/i/search.svg +12 -0
- data/docs/0.7.0/i/tree_bg.svg +8 -0
- data/docs/0.7.0/index.html +11 -0
- data/docs/0.7.0/js/highlight.pack.js +1 -0
- data/docs/0.7.0/js/jquery-1.3.2.min.js +19 -0
- data/docs/0.7.0/js/main.js +25 -0
- data/docs/0.7.0/js/navigation.js +142 -0
- data/docs/0.7.0/js/search_index.js +1 -0
- data/docs/0.7.0/js/searchdoc.js +465 -0
- data/docs/0.7.0/js/searcher.js +229 -0
- data/docs/0.7.0/panel/index.html +47 -0
- data/docs/0.7.0/panel/links.html +32 -0
- data/docs/0.7.0/panel/tree.js +1 -0
- data/docs/0.8.0/apple-touch-icon.png +0 -0
- data/docs/0.8.0/classes/Nanook.html +621 -0
- data/docs/0.8.0/classes/Nanook/Account.html +971 -0
- data/docs/0.8.0/classes/Nanook/Block.html +759 -0
- data/docs/0.8.0/classes/Nanook/Error.html +84 -0
- data/docs/0.8.0/classes/Nanook/Key.html +295 -0
- data/docs/0.8.0/classes/Nanook/Node.html +657 -0
- data/docs/0.8.0/classes/Nanook/Rpc.html +247 -0
- data/docs/0.8.0/classes/Nanook/Util.html +264 -0
- data/docs/0.8.0/classes/Nanook/Wallet.html +1056 -0
- data/docs/0.8.0/classes/Nanook/WalletAccount.html +582 -0
- data/docs/0.8.0/classes/Nanook/WorkPeer.html +294 -0
- data/docs/0.8.0/created.rid +14 -0
- data/docs/0.8.0/css/github.css +123 -0
- data/docs/0.8.0/css/main.css +374 -0
- data/docs/0.8.0/css/panel.css +360 -0
- data/docs/0.8.0/css/reset.css +48 -0
- data/docs/0.8.0/favicon.ico +0 -0
- data/docs/0.8.0/files/README_md.html +423 -0
- data/docs/0.8.0/files/lib/nanook/account_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/block_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/error_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/key_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/node_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/rpc_rb.html +99 -0
- data/docs/0.8.0/files/lib/nanook/util_rb.html +97 -0
- data/docs/0.8.0/files/lib/nanook/version_rb.html +84 -0
- data/docs/0.8.0/files/lib/nanook/wallet_account_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/wallet_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook/work_peer_rb.html +89 -0
- data/docs/0.8.0/files/lib/nanook_rb.html +94 -0
- data/docs/0.8.0/i/arrow-down.svg +8 -0
- data/docs/0.8.0/i/arrow-right.svg +8 -0
- data/docs/0.8.0/i/search.svg +12 -0
- data/docs/0.8.0/i/tree_bg.svg +8 -0
- data/docs/0.8.0/index.html +11 -0
- data/docs/0.8.0/js/highlight.pack.js +1 -0
- data/docs/0.8.0/js/jquery-1.3.2.min.js +19 -0
- data/docs/0.8.0/js/main.js +25 -0
- data/docs/0.8.0/js/navigation.js +142 -0
- data/docs/0.8.0/js/search_index.js +1 -0
- data/docs/0.8.0/js/searchdoc.js +465 -0
- data/docs/0.8.0/js/searcher.js +229 -0
- data/docs/0.8.0/panel/index.html +47 -0
- data/docs/0.8.0/panel/links.html +32 -0
- data/docs/0.8.0/panel/tree.js +1 -0
- data/docs/1.0.0/apple-touch-icon.png +0 -0
- data/docs/1.0.0/classes/Nanook.html +621 -0
- data/docs/1.0.0/classes/Nanook/Account.html +971 -0
- data/docs/1.0.0/classes/Nanook/Block.html +759 -0
- data/docs/1.0.0/classes/Nanook/Error.html +84 -0
- data/docs/1.0.0/classes/Nanook/Key.html +295 -0
- data/docs/1.0.0/classes/Nanook/Node.html +657 -0
- data/docs/1.0.0/classes/Nanook/Rpc.html +247 -0
- data/docs/1.0.0/classes/Nanook/Util.html +264 -0
- data/docs/1.0.0/classes/Nanook/Wallet.html +1056 -0
- data/docs/1.0.0/classes/Nanook/WalletAccount.html +582 -0
- data/docs/1.0.0/classes/Nanook/WorkPeer.html +294 -0
- data/docs/1.0.0/created.rid +14 -0
- data/docs/1.0.0/css/github.css +123 -0
- data/docs/1.0.0/css/main.css +374 -0
- data/docs/1.0.0/css/panel.css +360 -0
- data/docs/1.0.0/css/reset.css +48 -0
- data/docs/1.0.0/favicon.ico +0 -0
- data/docs/1.0.0/files/README_md.html +423 -0
- data/docs/1.0.0/files/lib/nanook/account_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/block_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/error_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/key_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/node_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/rpc_rb.html +99 -0
- data/docs/1.0.0/files/lib/nanook/util_rb.html +97 -0
- data/docs/1.0.0/files/lib/nanook/version_rb.html +84 -0
- data/docs/1.0.0/files/lib/nanook/wallet_account_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/wallet_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook/work_peer_rb.html +89 -0
- data/docs/1.0.0/files/lib/nanook_rb.html +94 -0
- data/docs/1.0.0/i/arrow-down.svg +8 -0
- data/docs/1.0.0/i/arrow-right.svg +8 -0
- data/docs/1.0.0/i/search.svg +12 -0
- data/docs/1.0.0/i/tree_bg.svg +8 -0
- data/docs/1.0.0/index.html +11 -0
- data/docs/1.0.0/js/highlight.pack.js +1 -0
- data/docs/1.0.0/js/jquery-1.3.2.min.js +19 -0
- data/docs/1.0.0/js/main.js +25 -0
- data/docs/1.0.0/js/navigation.js +142 -0
- data/docs/1.0.0/js/search_index.js +1 -0
- data/docs/1.0.0/js/searchdoc.js +465 -0
- data/docs/1.0.0/js/searcher.js +229 -0
- data/docs/1.0.0/panel/index.html +47 -0
- data/docs/1.0.0/panel/links.html +32 -0
- data/docs/1.0.0/panel/tree.js +1 -0
- data/docs/apple-touch-icon.png +0 -0
- data/docs/classes/Nanook.html +572 -0
- data/docs/classes/Nanook/Account.html +907 -0
- data/docs/classes/Nanook/Block.html +717 -0
- data/docs/classes/Nanook/Error.html +84 -0
- data/docs/classes/Nanook/Key.html +253 -0
- data/docs/classes/Nanook/Node.html +657 -0
- data/docs/classes/Nanook/Rpc.html +247 -0
- data/docs/classes/Nanook/Util.html +197 -0
- data/docs/classes/Nanook/Wallet.html +778 -0
- data/docs/classes/Nanook/WalletAccount.html +447 -0
- data/docs/classes/Nanook/WorkPeer.html +294 -0
- data/docs/created.rid +14 -0
- data/docs/css/github.css +123 -0
- data/docs/css/main.css +374 -0
- data/docs/css/panel.css +360 -0
- data/docs/css/reset.css +48 -0
- data/docs/favicon.ico +0 -0
- data/docs/files/README_md.html +408 -0
- data/docs/files/lib/nanook/account_rb.html +89 -0
- data/docs/files/lib/nanook/block_rb.html +89 -0
- data/docs/files/lib/nanook/error_rb.html +89 -0
- data/docs/files/lib/nanook/key_rb.html +89 -0
- data/docs/files/lib/nanook/node_rb.html +89 -0
- data/docs/files/lib/nanook/rpc_rb.html +99 -0
- data/docs/files/lib/nanook/util_rb.html +89 -0
- data/docs/files/lib/nanook/version_rb.html +84 -0
- data/docs/files/lib/nanook/wallet_account_rb.html +89 -0
- data/docs/files/lib/nanook/wallet_rb.html +89 -0
- data/docs/files/lib/nanook/work_peer_rb.html +89 -0
- data/docs/files/lib/nanook_rb.html +94 -0
- data/docs/i/arrow-down.svg +8 -0
- data/docs/i/arrow-right.svg +8 -0
- data/docs/i/search.svg +12 -0
- data/docs/i/tree_bg.svg +8 -0
- data/docs/index.html +11 -0
- data/docs/js/highlight.pack.js +1 -0
- data/docs/js/jquery-1.3.2.min.js +19 -0
- data/docs/js/main.js +25 -0
- data/docs/js/navigation.js +142 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/searchdoc.js +465 -0
- data/docs/js/searcher.js +229 -0
- data/docs/panel/index.html +47 -0
- data/docs/panel/links.html +32 -0
- data/docs/panel/tree.js +1 -0
- data/lib/nanook.rb +40 -4
- data/lib/nanook/account.rb +250 -8
- data/lib/nanook/block.rb +25 -2
- data/lib/nanook/key.rb +10 -2
- data/lib/nanook/node.rb +4 -0
- data/lib/nanook/rpc.rb +5 -1
- data/lib/nanook/util.rb +9 -1
- data/lib/nanook/version.rb +1 -1
- data/lib/nanook/wallet.rb +275 -14
- data/lib/nanook/wallet_account.rb +63 -11
- data/lib/nanook/work_peer.rb +4 -0
- metadata +188 -3
@@ -0,0 +1,446 @@
|
|
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"><
|
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'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-keyword">if</span> <span class="ruby-ivar">@account</span>
|
203
|
+
<span class="ruby-identifier">account_must_belong_to_wallet!</span>
|
204
|
+
<span class="ruby-keyword">end</span>
|
205
|
+
<span class="ruby-keyword">end</span></pre>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div class="sectiontitle">Instance Public methods</div>
|
214
|
+
|
215
|
+
<div class="method">
|
216
|
+
<div class="title method-title" id="method-i-create">
|
217
|
+
|
218
|
+
<b>create</b>()
|
219
|
+
|
220
|
+
<a href="../../classes/Nanook/WalletAccount.html#method-i-create" name="method-i-create" class="permalink">Link</a>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
|
224
|
+
<div class="description">
|
225
|
+
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
<div class="sourcecode">
|
236
|
+
|
237
|
+
<p class="source-link">
|
238
|
+
Source:
|
239
|
+
<a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
|
240
|
+
|
241
|
+
</p>
|
242
|
+
<div id="method-i-create_source" class="dyn-source">
|
243
|
+
<pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 23</span>
|
244
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>
|
245
|
+
<span class="ruby-identifier">wallet_required!</span>
|
246
|
+
<span class="ruby-identifier">rpc</span>(<span class="ruby-value">:account_create</span>)[<span class="ruby-value">:account</span>]
|
247
|
+
<span class="ruby-keyword">end</span></pre>
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div class="method">
|
254
|
+
<div class="title method-title" id="method-i-destroy">
|
255
|
+
|
256
|
+
<b>destroy</b>()
|
257
|
+
|
258
|
+
<a href="../../classes/Nanook/WalletAccount.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
<div class="description">
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
<div class="sourcecode">
|
274
|
+
|
275
|
+
<p class="source-link">
|
276
|
+
Source:
|
277
|
+
<a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
|
278
|
+
|
279
|
+
</p>
|
280
|
+
<div id="method-i-destroy_source" class="dyn-source">
|
281
|
+
<pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 28</span>
|
282
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">destroy</span>
|
283
|
+
<span class="ruby-identifier">wallet_required!</span>
|
284
|
+
(<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>
|
285
|
+
<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>
|
286
|
+
<span class="ruby-keyword">end</span>
|
287
|
+
<span class="ruby-keyword">end</span></pre>
|
288
|
+
</div>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div class="method">
|
294
|
+
<div class="title method-title" id="method-i-method_missing">
|
295
|
+
|
296
|
+
<b>method_missing</b>(m, *args, &block)
|
297
|
+
|
298
|
+
<a href="../../classes/Nanook/WalletAccount.html#method-i-method_missing" name="method-i-method_missing" class="permalink">Link</a>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
|
302
|
+
<div class="description">
|
303
|
+
<p>Any method of <a href="Account.html">Nanook::Account</a> can be called on
|
304
|
+
this class too</p>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
<div class="sourcecode">
|
315
|
+
|
316
|
+
<p class="source-link">
|
317
|
+
Source:
|
318
|
+
<a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
|
319
|
+
|
320
|
+
</p>
|
321
|
+
<div id="method-i-method_missing_source" class="dyn-source">
|
322
|
+
<pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 75</span>
|
323
|
+
<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">&</span><span class="ruby-identifier">block</span>)
|
324
|
+
<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>)
|
325
|
+
<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">&</span><span class="ruby-identifier">block</span>)
|
326
|
+
<span class="ruby-keyword">else</span>
|
327
|
+
<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">&</span><span class="ruby-identifier">block</span>)
|
328
|
+
<span class="ruby-keyword">end</span>
|
329
|
+
<span class="ruby-keyword">end</span></pre>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
<div class="method">
|
336
|
+
<div class="title method-title" id="method-i-pay">
|
337
|
+
|
338
|
+
<b>pay</b>(to:, amount:, id:)
|
339
|
+
|
340
|
+
<a href="../../classes/Nanook/WalletAccount.html#method-i-pay" name="method-i-pay" class="permalink">Link</a>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
<div class="description">
|
345
|
+
|
346
|
+
</div>
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<div class="sourcecode">
|
356
|
+
|
357
|
+
<p class="source-link">
|
358
|
+
Source:
|
359
|
+
<a href="javascript:toggleSource('method-i-pay_source')" id="l_method-i-pay_source">show</a>
|
360
|
+
|
361
|
+
</p>
|
362
|
+
<div id="method-i-pay_source" class="dyn-source">
|
363
|
+
<pre><span class="ruby-comment"># File lib/nanook/wallet_account.rb, line 35</span>
|
364
|
+
<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>)
|
365
|
+
<span class="ruby-identifier">wallet_required!</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">"To account does not exist (#{to})"</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'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>[<span class="ruby-value">:error</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
|
+
|
428
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">nil?</span>
|
429
|
+
<span class="ruby-identifier">_receive_without_block</span>
|
430
|
+
<span class="ruby-keyword">else</span>
|
431
|
+
<span class="ruby-identifier">_receive_with_block</span>(<span class="ruby-identifier">block</span>)
|
432
|
+
<span class="ruby-keyword">end</span>
|
433
|
+
<span class="ruby-keyword">end</span></pre>
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
</div>
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
</body>
|
446
|
+
</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"><
|
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>
|