nanook 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/nanook/version.rb +1 -1
  4. data/nanook.gemspec +1 -1
  5. metadata +1 -185
  6. data/docs/0.7.0/apple-touch-icon.png +0 -0
  7. data/docs/0.7.0/classes/Nanook.html +0 -572
  8. data/docs/0.7.0/classes/Nanook/Account.html +0 -909
  9. data/docs/0.7.0/classes/Nanook/Block.html +0 -717
  10. data/docs/0.7.0/classes/Nanook/Error.html +0 -84
  11. data/docs/0.7.0/classes/Nanook/Key.html +0 -253
  12. data/docs/0.7.0/classes/Nanook/Node.html +0 -657
  13. data/docs/0.7.0/classes/Nanook/Rpc.html +0 -247
  14. data/docs/0.7.0/classes/Nanook/Util.html +0 -197
  15. data/docs/0.7.0/classes/Nanook/Wallet.html +0 -986
  16. data/docs/0.7.0/classes/Nanook/WalletAccount.html +0 -446
  17. data/docs/0.7.0/classes/Nanook/WorkPeer.html +0 -294
  18. data/docs/0.7.0/created.rid +0 -14
  19. data/docs/0.7.0/css/github.css +0 -123
  20. data/docs/0.7.0/css/main.css +0 -374
  21. data/docs/0.7.0/css/panel.css +0 -360
  22. data/docs/0.7.0/css/reset.css +0 -48
  23. data/docs/0.7.0/favicon.ico +0 -0
  24. data/docs/0.7.0/files/README_md.html +0 -418
  25. data/docs/0.7.0/files/lib/nanook/account_rb.html +0 -89
  26. data/docs/0.7.0/files/lib/nanook/block_rb.html +0 -89
  27. data/docs/0.7.0/files/lib/nanook/error_rb.html +0 -89
  28. data/docs/0.7.0/files/lib/nanook/key_rb.html +0 -89
  29. data/docs/0.7.0/files/lib/nanook/node_rb.html +0 -89
  30. data/docs/0.7.0/files/lib/nanook/rpc_rb.html +0 -99
  31. data/docs/0.7.0/files/lib/nanook/util_rb.html +0 -89
  32. data/docs/0.7.0/files/lib/nanook/version_rb.html +0 -84
  33. data/docs/0.7.0/files/lib/nanook/wallet_account_rb.html +0 -89
  34. data/docs/0.7.0/files/lib/nanook/wallet_rb.html +0 -89
  35. data/docs/0.7.0/files/lib/nanook/work_peer_rb.html +0 -89
  36. data/docs/0.7.0/files/lib/nanook_rb.html +0 -94
  37. data/docs/0.7.0/i/arrow-down.svg +0 -8
  38. data/docs/0.7.0/i/arrow-right.svg +0 -8
  39. data/docs/0.7.0/i/search.svg +0 -12
  40. data/docs/0.7.0/i/tree_bg.svg +0 -8
  41. data/docs/0.7.0/index.html +0 -11
  42. data/docs/0.7.0/js/highlight.pack.js +0 -1
  43. data/docs/0.7.0/js/jquery-1.3.2.min.js +0 -19
  44. data/docs/0.7.0/js/main.js +0 -25
  45. data/docs/0.7.0/js/navigation.js +0 -142
  46. data/docs/0.7.0/js/search_index.js +0 -1
  47. data/docs/0.7.0/js/searchdoc.js +0 -465
  48. data/docs/0.7.0/js/searcher.js +0 -229
  49. data/docs/0.7.0/panel/index.html +0 -47
  50. data/docs/0.7.0/panel/links.html +0 -32
  51. data/docs/0.7.0/panel/tree.js +0 -1
  52. data/docs/0.8.0/apple-touch-icon.png +0 -0
  53. data/docs/0.8.0/classes/Nanook.html +0 -621
  54. data/docs/0.8.0/classes/Nanook/Account.html +0 -971
  55. data/docs/0.8.0/classes/Nanook/Block.html +0 -759
  56. data/docs/0.8.0/classes/Nanook/Error.html +0 -84
  57. data/docs/0.8.0/classes/Nanook/Key.html +0 -295
  58. data/docs/0.8.0/classes/Nanook/Node.html +0 -657
  59. data/docs/0.8.0/classes/Nanook/Rpc.html +0 -247
  60. data/docs/0.8.0/classes/Nanook/Util.html +0 -264
  61. data/docs/0.8.0/classes/Nanook/Wallet.html +0 -1056
  62. data/docs/0.8.0/classes/Nanook/WalletAccount.html +0 -582
  63. data/docs/0.8.0/classes/Nanook/WorkPeer.html +0 -294
  64. data/docs/0.8.0/created.rid +0 -14
  65. data/docs/0.8.0/css/github.css +0 -123
  66. data/docs/0.8.0/css/main.css +0 -374
  67. data/docs/0.8.0/css/panel.css +0 -360
  68. data/docs/0.8.0/css/reset.css +0 -48
  69. data/docs/0.8.0/favicon.ico +0 -0
  70. data/docs/0.8.0/files/README_md.html +0 -423
  71. data/docs/0.8.0/files/lib/nanook/account_rb.html +0 -89
  72. data/docs/0.8.0/files/lib/nanook/block_rb.html +0 -89
  73. data/docs/0.8.0/files/lib/nanook/error_rb.html +0 -89
  74. data/docs/0.8.0/files/lib/nanook/key_rb.html +0 -89
  75. data/docs/0.8.0/files/lib/nanook/node_rb.html +0 -89
  76. data/docs/0.8.0/files/lib/nanook/rpc_rb.html +0 -99
  77. data/docs/0.8.0/files/lib/nanook/util_rb.html +0 -97
  78. data/docs/0.8.0/files/lib/nanook/version_rb.html +0 -84
  79. data/docs/0.8.0/files/lib/nanook/wallet_account_rb.html +0 -89
  80. data/docs/0.8.0/files/lib/nanook/wallet_rb.html +0 -89
  81. data/docs/0.8.0/files/lib/nanook/work_peer_rb.html +0 -89
  82. data/docs/0.8.0/files/lib/nanook_rb.html +0 -94
  83. data/docs/0.8.0/i/arrow-down.svg +0 -8
  84. data/docs/0.8.0/i/arrow-right.svg +0 -8
  85. data/docs/0.8.0/i/search.svg +0 -12
  86. data/docs/0.8.0/i/tree_bg.svg +0 -8
  87. data/docs/0.8.0/index.html +0 -11
  88. data/docs/0.8.0/js/highlight.pack.js +0 -1
  89. data/docs/0.8.0/js/jquery-1.3.2.min.js +0 -19
  90. data/docs/0.8.0/js/main.js +0 -25
  91. data/docs/0.8.0/js/navigation.js +0 -142
  92. data/docs/0.8.0/js/search_index.js +0 -1
  93. data/docs/0.8.0/js/searchdoc.js +0 -465
  94. data/docs/0.8.0/js/searcher.js +0 -229
  95. data/docs/0.8.0/panel/index.html +0 -47
  96. data/docs/0.8.0/panel/links.html +0 -32
  97. data/docs/0.8.0/panel/tree.js +0 -1
  98. data/docs/1.0.0/apple-touch-icon.png +0 -0
  99. data/docs/1.0.0/classes/Nanook.html +0 -621
  100. data/docs/1.0.0/classes/Nanook/Account.html +0 -989
  101. data/docs/1.0.0/classes/Nanook/Block.html +0 -929
  102. data/docs/1.0.0/classes/Nanook/Error.html +0 -84
  103. data/docs/1.0.0/classes/Nanook/Key.html +0 -295
  104. data/docs/1.0.0/classes/Nanook/Node.html +0 -657
  105. data/docs/1.0.0/classes/Nanook/Rpc.html +0 -247
  106. data/docs/1.0.0/classes/Nanook/Util.html +0 -264
  107. data/docs/1.0.0/classes/Nanook/Wallet.html +0 -1084
  108. data/docs/1.0.0/classes/Nanook/WalletAccount.html +0 -582
  109. data/docs/1.0.0/classes/Nanook/WorkPeer.html +0 -294
  110. data/docs/1.0.0/created.rid +0 -14
  111. data/docs/1.0.0/css/github.css +0 -123
  112. data/docs/1.0.0/css/main.css +0 -374
  113. data/docs/1.0.0/css/panel.css +0 -360
  114. data/docs/1.0.0/css/reset.css +0 -48
  115. data/docs/1.0.0/favicon.ico +0 -0
  116. data/docs/1.0.0/files/README_md.html +0 -443
  117. data/docs/1.0.0/files/lib/nanook/account_rb.html +0 -89
  118. data/docs/1.0.0/files/lib/nanook/block_rb.html +0 -89
  119. data/docs/1.0.0/files/lib/nanook/error_rb.html +0 -89
  120. data/docs/1.0.0/files/lib/nanook/key_rb.html +0 -89
  121. data/docs/1.0.0/files/lib/nanook/node_rb.html +0 -89
  122. data/docs/1.0.0/files/lib/nanook/rpc_rb.html +0 -99
  123. data/docs/1.0.0/files/lib/nanook/util_rb.html +0 -97
  124. data/docs/1.0.0/files/lib/nanook/version_rb.html +0 -84
  125. data/docs/1.0.0/files/lib/nanook/wallet_account_rb.html +0 -89
  126. data/docs/1.0.0/files/lib/nanook/wallet_rb.html +0 -89
  127. data/docs/1.0.0/files/lib/nanook/work_peer_rb.html +0 -89
  128. data/docs/1.0.0/files/lib/nanook_rb.html +0 -94
  129. data/docs/1.0.0/i/arrow-down.svg +0 -8
  130. data/docs/1.0.0/i/arrow-right.svg +0 -8
  131. data/docs/1.0.0/i/search.svg +0 -12
  132. data/docs/1.0.0/i/tree_bg.svg +0 -8
  133. data/docs/1.0.0/index.html +0 -11
  134. data/docs/1.0.0/js/highlight.pack.js +0 -1
  135. data/docs/1.0.0/js/jquery-1.3.2.min.js +0 -19
  136. data/docs/1.0.0/js/main.js +0 -25
  137. data/docs/1.0.0/js/navigation.js +0 -142
  138. data/docs/1.0.0/js/search_index.js +0 -1
  139. data/docs/1.0.0/js/searchdoc.js +0 -465
  140. data/docs/1.0.0/js/searcher.js +0 -229
  141. data/docs/1.0.0/panel/index.html +0 -47
  142. data/docs/1.0.0/panel/links.html +0 -32
  143. data/docs/1.0.0/panel/tree.js +0 -1
  144. data/docs/apple-touch-icon.png +0 -0
  145. data/docs/classes/Nanook.html +0 -572
  146. data/docs/classes/Nanook/Account.html +0 -907
  147. data/docs/classes/Nanook/Block.html +0 -717
  148. data/docs/classes/Nanook/Error.html +0 -84
  149. data/docs/classes/Nanook/Key.html +0 -253
  150. data/docs/classes/Nanook/Node.html +0 -657
  151. data/docs/classes/Nanook/Rpc.html +0 -247
  152. data/docs/classes/Nanook/Util.html +0 -197
  153. data/docs/classes/Nanook/Wallet.html +0 -778
  154. data/docs/classes/Nanook/WalletAccount.html +0 -447
  155. data/docs/classes/Nanook/WorkPeer.html +0 -294
  156. data/docs/created.rid +0 -14
  157. data/docs/css/github.css +0 -123
  158. data/docs/css/main.css +0 -374
  159. data/docs/css/panel.css +0 -360
  160. data/docs/css/reset.css +0 -48
  161. data/docs/favicon.ico +0 -0
  162. data/docs/files/README_md.html +0 -408
  163. data/docs/files/lib/nanook/account_rb.html +0 -89
  164. data/docs/files/lib/nanook/block_rb.html +0 -89
  165. data/docs/files/lib/nanook/error_rb.html +0 -89
  166. data/docs/files/lib/nanook/key_rb.html +0 -89
  167. data/docs/files/lib/nanook/node_rb.html +0 -89
  168. data/docs/files/lib/nanook/rpc_rb.html +0 -99
  169. data/docs/files/lib/nanook/util_rb.html +0 -89
  170. data/docs/files/lib/nanook/version_rb.html +0 -84
  171. data/docs/files/lib/nanook/wallet_account_rb.html +0 -89
  172. data/docs/files/lib/nanook/wallet_rb.html +0 -89
  173. data/docs/files/lib/nanook/work_peer_rb.html +0 -89
  174. data/docs/files/lib/nanook_rb.html +0 -94
  175. data/docs/i/arrow-down.svg +0 -8
  176. data/docs/i/arrow-right.svg +0 -8
  177. data/docs/i/search.svg +0 -12
  178. data/docs/i/tree_bg.svg +0 -8
  179. data/docs/index.html +0 -11
  180. data/docs/js/highlight.pack.js +0 -1
  181. data/docs/js/jquery-1.3.2.min.js +0 -19
  182. data/docs/js/main.js +0 -25
  183. data/docs/js/navigation.js +0 -142
  184. data/docs/js/search_index.js +0 -1
  185. data/docs/js/searchdoc.js +0 -465
  186. data/docs/js/searcher.js +0 -229
  187. data/docs/panel/index.html +0 -47
  188. data/docs/panel/links.html +0 -32
  189. data/docs/panel/tree.js +0 -1
@@ -1,247 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Nanook::Rpc</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::Rpc">
15
-
16
-
17
-
18
- <meta name="keywords" content="Nanook::Rpc class">
19
-
20
- <meta name="keywords" content="new, call">
21
-
22
- </head>
23
-
24
- <body>
25
- <div class="banner">
26
-
27
- <h1>
28
- <span class="type">Class</span>
29
- Nanook::Rpc
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/rpc_rb.html">lib/nanook/rpc.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-call">call</a>
71
- </li>
72
-
73
- </ul>
74
- </dd>
75
-
76
- <dt>N</dt>
77
- <dd>
78
- <ul>
79
-
80
-
81
- <li>
82
- <a href="#method-c-new">new</a>
83
- </li>
84
-
85
- </ul>
86
- </dd>
87
-
88
- </dl>
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
- <!-- Section constants -->
103
- <div class="sectiontitle">Constants</div>
104
- <table border='0' cellpadding='5'>
105
-
106
- <tr valign='top'>
107
- <td class="attr-name">DEFAULT_TIMEOUT</td>
108
- <td>=</td>
109
- <td class="attr-value">500</td>
110
- </tr>
111
-
112
- <tr valign='top'>
113
- <td>&nbsp;</td>
114
- <td colspan="2" class="attr-desc"></td>
115
- </tr>
116
-
117
-
118
- <tr valign='top'>
119
- <td class="attr-name">DEFAULT_URI</td>
120
- <td>=</td>
121
- <td class="attr-value">&quot;http://localhost:7076&quot;</td>
122
- </tr>
123
-
124
- <tr valign='top'>
125
- <td>&nbsp;</td>
126
- <td colspan="2" class="attr-desc"></td>
127
- </tr>
128
-
129
-
130
- </table>
131
-
132
-
133
-
134
-
135
-
136
-
137
- <!-- Methods -->
138
-
139
- <div class="sectiontitle">Class Public methods</div>
140
-
141
- <div class="method">
142
- <div class="title method-title" id="method-c-new">
143
-
144
- <b>new</b>(uri=DEFAULT_URI, timeout:DEFAULT_TIMEOUT)
145
-
146
- <a href="../../classes/Nanook/Rpc.html#method-c-new" name="method-c-new" class="permalink">Link</a>
147
- </div>
148
-
149
-
150
- <div class="description">
151
-
152
- </div>
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
- <div class="sourcecode">
162
-
163
- <p class="source-link">
164
- Source:
165
- <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
166
-
167
- </p>
168
- <div id="method-c-new_source" class="dyn-source">
169
- <pre><span class="ruby-comment"># File lib/nanook/rpc.rb, line 10</span>
170
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">uri</span>=<span class="ruby-constant">DEFAULT_URI</span>, <span class="ruby-value">timeout:</span><span class="ruby-constant">DEFAULT_TIMEOUT</span>)
171
- <span class="ruby-identifier">rpc_server</span> = <span class="ruby-constant">URI</span>(<span class="ruby-identifier">uri</span>)
172
-
173
- <span class="ruby-keyword">unless</span> [<span class="ruby-string">&#39;http&#39;</span>, <span class="ruby-string">&#39;https&#39;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">rpc_server</span>.<span class="ruby-identifier">scheme</span>)
174
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;URI must have http or https in it. Was given: #{uri}&quot;</span>)
175
- <span class="ruby-keyword">end</span>
176
-
177
- <span class="ruby-ivar">@http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rpc_server</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">rpc_server</span>.<span class="ruby-identifier">port</span>)
178
- <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">read_timeout</span> = <span class="ruby-identifier">timeout</span>
179
- <span class="ruby-ivar">@request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rpc_server</span>.<span class="ruby-identifier">request_uri</span>, {<span class="ruby-string">&quot;user-agent&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;Ruby nanook gem&quot;</span>})
180
- <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">content_type</span> = <span class="ruby-string">&quot;application/json&quot;</span>
181
- <span class="ruby-keyword">end</span></pre>
182
- </div>
183
- </div>
184
-
185
- </div>
186
-
187
-
188
-
189
- <div class="sectiontitle">Instance Public methods</div>
190
-
191
- <div class="method">
192
- <div class="title method-title" id="method-i-call">
193
-
194
- <b>call</b>(action, params={})
195
-
196
- <a href="../../classes/Nanook/Rpc.html#method-i-call" name="method-i-call" class="permalink">Link</a>
197
- </div>
198
-
199
-
200
- <div class="description">
201
-
202
- </div>
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
- <div class="sourcecode">
212
-
213
- <p class="source-link">
214
- Source:
215
- <a href="javascript:toggleSource('method-i-call_source')" id="l_method-i-call_source">show</a>
216
-
217
- </p>
218
- <div id="method-i-call_source" class="dyn-source">
219
- <pre><span class="ruby-comment"># File lib/nanook/rpc.rb, line 23</span>
220
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">call</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">params</span>={})
221
- <span class="ruby-comment"># Stringify param values</span>
222
- <span class="ruby-identifier">params</span> = <span class="ruby-constant">Hash</span>[<span class="ruby-identifier">params</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>] }]
223
-
224
- <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span> = { <span class="ruby-value">action:</span> <span class="ruby-identifier">action</span> }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">params</span>).<span class="ruby-identifier">to_json</span>
225
-
226
- <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-ivar">@request</span>)
227
-
228
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPSuccess</span>)
229
- <span class="ruby-identifier">hash</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>)
230
- <span class="ruby-identifier">process_hash</span>(<span class="ruby-identifier">hash</span>)
231
- <span class="ruby-keyword">else</span>
232
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;Encountered net/http error #{response.code}: #{response.class.name}&quot;</span>)
233
- <span class="ruby-keyword">end</span>
234
- <span class="ruby-keyword">end</span></pre>
235
- </div>
236
- </div>
237
-
238
- </div>
239
-
240
-
241
-
242
-
243
- </div>
244
-
245
- </div>
246
- </body>
247
- </html>
@@ -1,197 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Nanook::Util</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::Util">
15
-
16
-
17
-
18
- <meta name="keywords" content="Nanook::Util class">
19
-
20
- <meta name="keywords" content="NANO_to_raw, coerce_empty_string_to_type">
21
-
22
- </head>
23
-
24
- <body>
25
- <div class="banner">
26
-
27
- <h1>
28
- <span class="type">Class</span>
29
- Nanook::Util
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/util_rb.html">lib/nanook/util.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>N</dt>
65
- <dd>
66
- <ul>
67
-
68
-
69
- <li>
70
- <a href="#method-c-NANO_to_raw">NANO_to_raw</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-c-coerce_empty_string_to_type">coerce_empty_string_to_type</a>
83
- </li>
84
-
85
- </ul>
86
- </dd>
87
-
88
- </dl>
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
- <!-- Methods -->
108
-
109
- <div class="sectiontitle">Class Public methods</div>
110
-
111
- <div class="method">
112
- <div class="title method-title" id="method-c-NANO_to_raw">
113
-
114
- <b>NANO_to_raw</b>(nano)
115
-
116
- <a href="../../classes/Nanook/Util.html#method-c-NANO_to_raw" name="method-c-NANO_to_raw" class="permalink">Link</a>
117
- </div>
118
-
119
-
120
- <div class="description">
121
-
122
- </div>
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
- <div class="sourcecode">
132
-
133
- <p class="source-link">
134
- Source:
135
- <a href="javascript:toggleSource('method-c-NANO_to_raw_source')" id="l_method-c-NANO_to_raw_source">show</a>
136
-
137
- </p>
138
- <div id="method-c-NANO_to_raw_source" class="dyn-source">
139
- <pre><span class="ruby-comment"># File lib/nanook/util.rb, line 4</span>
140
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-constant">NANO_to_raw</span>(<span class="ruby-identifier ruby-title">nano</span>)
141
- <span class="ruby-identifier">nano</span> <span class="ruby-operator">*</span> (<span class="ruby-value">10</span><span class="ruby-operator">**</span><span class="ruby-value">30</span>)
142
- <span class="ruby-keyword">end</span></pre>
143
- </div>
144
- </div>
145
-
146
- </div>
147
-
148
- <div class="method">
149
- <div class="title method-title" id="method-c-coerce_empty_string_to_type">
150
-
151
- <b>coerce_empty_string_to_type</b>(response, type)
152
-
153
- <a href="../../classes/Nanook/Util.html#method-c-coerce_empty_string_to_type" name="method-c-coerce_empty_string_to_type" class="permalink">Link</a>
154
- </div>
155
-
156
-
157
- <div class="description">
158
-
159
- </div>
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
- <div class="sourcecode">
169
-
170
- <p class="source-link">
171
- Source:
172
- <a href="javascript:toggleSource('method-c-coerce_empty_string_to_type_source')" id="l_method-c-coerce_empty_string_to_type_source">show</a>
173
-
174
- </p>
175
- <div id="method-c-coerce_empty_string_to_type_source" class="dyn-source">
176
- <pre><span class="ruby-comment"># File lib/nanook/util.rb, line 8</span>
177
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">coerce_empty_string_to_type</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">type</span>)
178
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;&quot;</span>
179
- <span class="ruby-keyword">return</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">new</span>
180
- <span class="ruby-keyword">end</span>
181
-
182
- <span class="ruby-identifier">response</span>
183
- <span class="ruby-keyword">end</span></pre>
184
- </div>
185
- </div>
186
-
187
- </div>
188
-
189
-
190
-
191
-
192
-
193
- </div>
194
-
195
- </div>
196
- </body>
197
- </html>
@@ -1,778 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Nanook::Wallet</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::Wallet">
15
-
16
-
17
-
18
- <meta name="keywords" content="Nanook::Wallet class">
19
-
20
- <meta name="keywords" content="new, account, accounts, balance, create, destroy, export, contains?, pay, receive, locked?, unlock, change_password, all">
21
-
22
- </head>
23
-
24
- <body>
25
- <div class="banner">
26
-
27
- <h1>
28
- <span class="type">Class</span>
29
- Nanook::Wallet
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_rb.html">lib/nanook/wallet.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-account">account</a>,
71
- </li>
72
-
73
-
74
- <li>
75
- <a href="#method-i-accounts">accounts</a>,
76
- </li>
77
-
78
-
79
- <li>
80
- <a href="#method-i-all">all</a>
81
- </li>
82
-
83
- </ul>
84
- </dd>
85
-
86
- <dt>B</dt>
87
- <dd>
88
- <ul>
89
-
90
-
91
- <li>
92
- <a href="#method-i-balance">balance</a>
93
- </li>
94
-
95
- </ul>
96
- </dd>
97
-
98
- <dt>C</dt>
99
- <dd>
100
- <ul>
101
-
102
-
103
- <li>
104
- <a href="#method-i-change_password">change_password</a>,
105
- </li>
106
-
107
-
108
- <li>
109
- <a href="#method-i-contains-3F">contains?</a>,
110
- </li>
111
-
112
-
113
- <li>
114
- <a href="#method-i-create">create</a>
115
- </li>
116
-
117
- </ul>
118
- </dd>
119
-
120
- <dt>D</dt>
121
- <dd>
122
- <ul>
123
-
124
-
125
- <li>
126
- <a href="#method-i-destroy">destroy</a>
127
- </li>
128
-
129
- </ul>
130
- </dd>
131
-
132
- <dt>E</dt>
133
- <dd>
134
- <ul>
135
-
136
-
137
- <li>
138
- <a href="#method-i-export">export</a>
139
- </li>
140
-
141
- </ul>
142
- </dd>
143
-
144
- <dt>L</dt>
145
- <dd>
146
- <ul>
147
-
148
-
149
- <li>
150
- <a href="#method-i-locked-3F">locked?</a>
151
- </li>
152
-
153
- </ul>
154
- </dd>
155
-
156
- <dt>N</dt>
157
- <dd>
158
- <ul>
159
-
160
-
161
- <li>
162
- <a href="#method-c-new">new</a>
163
- </li>
164
-
165
- </ul>
166
- </dd>
167
-
168
- <dt>P</dt>
169
- <dd>
170
- <ul>
171
-
172
-
173
- <li>
174
- <a href="#method-i-pay">pay</a>
175
- </li>
176
-
177
- </ul>
178
- </dd>
179
-
180
- <dt>R</dt>
181
- <dd>
182
- <ul>
183
-
184
-
185
- <li>
186
- <a href="#method-i-receive">receive</a>
187
- </li>
188
-
189
- </ul>
190
- </dd>
191
-
192
- <dt>U</dt>
193
- <dd>
194
- <ul>
195
-
196
-
197
- <li>
198
- <a href="#method-i-unlock">unlock</a>
199
- </li>
200
-
201
- </ul>
202
- </dd>
203
-
204
- </dl>
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
- <!-- Methods -->
224
-
225
- <div class="sectiontitle">Class Public methods</div>
226
-
227
- <div class="method">
228
- <div class="title method-title" id="method-c-new">
229
-
230
- <b>new</b>(rpc, wallet)
231
-
232
- <a href="../../classes/Nanook/Wallet.html#method-c-new" name="method-c-new" class="permalink">Link</a>
233
- </div>
234
-
235
-
236
- <div class="description">
237
-
238
- </div>
239
-
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
- <div class="sourcecode">
248
-
249
- <p class="source-link">
250
- Source:
251
- <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
252
-
253
- </p>
254
- <div id="method-c-new_source" class="dyn-source">
255
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 4</span>
256
- <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>)
257
- <span class="ruby-ivar">@rpc</span> = <span class="ruby-identifier">rpc</span>
258
- <span class="ruby-ivar">@wallet</span> = <span class="ruby-identifier">wallet</span>
259
- <span class="ruby-keyword">end</span></pre>
260
- </div>
261
- </div>
262
-
263
- </div>
264
-
265
-
266
-
267
- <div class="sectiontitle">Instance Public methods</div>
268
-
269
- <div class="method">
270
- <div class="title method-title" id="method-i-account">
271
-
272
- <b>account</b>(account=nil)
273
-
274
- <a href="../../classes/Nanook/Wallet.html#method-i-account" name="method-i-account" class="permalink">Link</a>
275
- </div>
276
-
277
-
278
- <div class="description">
279
-
280
- </div>
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
- <div class="sourcecode">
290
-
291
- <p class="source-link">
292
- Source:
293
- <a href="javascript:toggleSource('method-i-account_source')" id="l_method-i-account_source">show</a>
294
-
295
- </p>
296
- <div id="method-i-account_source" class="dyn-source">
297
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 9</span>
298
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">account</span>(<span class="ruby-identifier">account</span>=<span class="ruby-keyword">nil</span>)
299
- <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">WalletAccount</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@rpc</span>, <span class="ruby-ivar">@wallet</span>, <span class="ruby-identifier">account</span>)
300
- <span class="ruby-keyword">end</span></pre>
301
- </div>
302
- </div>
303
-
304
- </div>
305
-
306
- <div class="method">
307
- <div class="title method-title" id="method-i-accounts">
308
-
309
- <b>accounts</b>()
310
-
311
- <a href="../../classes/Nanook/Wallet.html#method-i-accounts" name="method-i-accounts" class="permalink">Link</a>
312
- </div>
313
-
314
-
315
- <div class="description">
316
-
317
- </div>
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
- <div class="sourcecode">
327
-
328
- <p class="source-link">
329
- Source:
330
- <a href="javascript:toggleSource('method-i-accounts_source')" id="l_method-i-accounts_source">show</a>
331
-
332
- </p>
333
- <div id="method-i-accounts_source" class="dyn-source">
334
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 13</span>
335
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accounts</span>
336
- <span class="ruby-identifier">wallet_required!</span>
337
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:account_list</span>)[<span class="ruby-value">:accounts</span>]
338
- <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">coerce_empty_string_to_type</span>(<span class="ruby-identifier">response</span>, <span class="ruby-constant">Array</span>)
339
- <span class="ruby-keyword">end</span></pre>
340
- </div>
341
- </div>
342
-
343
- </div>
344
-
345
- <div class="method">
346
- <div class="title method-title" id="method-i-all">
347
-
348
- <b>all</b>()
349
-
350
- <a href="../../classes/Nanook/Wallet.html#method-i-all" name="method-i-all" class="permalink">Link</a>
351
- </div>
352
-
353
-
354
- <div class="description">
355
-
356
- </div>
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
- <div class="sourcecode">
366
-
367
- <p class="source-link">
368
- Source:
369
- <a href="javascript:toggleSource('method-i-all_source')" id="l_method-i-all_source">show</a>
370
-
371
- </p>
372
- <div id="method-i-all_source" class="dyn-source">
373
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 78</span>
374
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">all</span>
375
- <span class="ruby-identifier">wallet_required!</span>
376
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:account_list</span>)[<span class="ruby-value">:accounts</span>]
377
- <span class="ruby-keyword">end</span></pre>
378
- </div>
379
- </div>
380
-
381
- </div>
382
-
383
- <div class="method">
384
- <div class="title method-title" id="method-i-balance">
385
-
386
- <b>balance</b>(account_break_down: false)
387
-
388
- <a href="../../classes/Nanook/Wallet.html#method-i-balance" name="method-i-balance" class="permalink">Link</a>
389
- </div>
390
-
391
-
392
- <div class="description">
393
-
394
- </div>
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
- <div class="sourcecode">
404
-
405
- <p class="source-link">
406
- Source:
407
- <a href="javascript:toggleSource('method-i-balance_source')" id="l_method-i-balance_source">show</a>
408
-
409
- </p>
410
- <div id="method-i-balance_source" class="dyn-source">
411
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 19</span>
412
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">balance</span>(<span class="ruby-value">account_break_down:</span> <span class="ruby-keyword">false</span>)
413
- <span class="ruby-identifier">wallet_required!</span>
414
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">account_break_down</span>
415
- <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">coerce_empty_string_to_type</span>(<span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_balances</span>)[<span class="ruby-value">:balances</span>], <span class="ruby-constant">Hash</span>)
416
- <span class="ruby-keyword">else</span>
417
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_balance_total</span>)
418
- <span class="ruby-keyword">end</span>
419
- <span class="ruby-keyword">end</span></pre>
420
- </div>
421
- </div>
422
-
423
- </div>
424
-
425
- <div class="method">
426
- <div class="title method-title" id="method-i-change_password">
427
-
428
- <b>change_password</b>(password)
429
-
430
- <a href="../../classes/Nanook/Wallet.html#method-i-change_password" name="method-i-change_password" class="permalink">Link</a>
431
- </div>
432
-
433
-
434
- <div class="description">
435
-
436
- </div>
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
- <div class="sourcecode">
446
-
447
- <p class="source-link">
448
- Source:
449
- <a href="javascript:toggleSource('method-i-change_password_source')" id="l_method-i-change_password_source">show</a>
450
-
451
- </p>
452
- <div id="method-i-change_password_source" class="dyn-source">
453
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 73</span>
454
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_password</span>(<span class="ruby-identifier">password</span>)
455
- <span class="ruby-identifier">wallet_required!</span>
456
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:password_change</span>, <span class="ruby-value">password:</span> <span class="ruby-identifier">password</span>)[<span class="ruby-value">:changed</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
457
- <span class="ruby-keyword">end</span></pre>
458
- </div>
459
- </div>
460
-
461
- </div>
462
-
463
- <div class="method">
464
- <div class="title method-title" id="method-i-contains-3F">
465
-
466
- <b>contains?</b>(account)
467
-
468
- <a href="../../classes/Nanook/Wallet.html#method-i-contains-3F" name="method-i-contains-3F" class="permalink">Link</a>
469
- </div>
470
-
471
-
472
- <div class="description">
473
-
474
- </div>
475
-
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
- <div class="sourcecode">
484
-
485
- <p class="source-link">
486
- Source:
487
- <a href="javascript:toggleSource('method-i-contains-3F_source')" id="l_method-i-contains-3F_source">show</a>
488
-
489
- </p>
490
- <div id="method-i-contains-3F_source" class="dyn-source">
491
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 44</span>
492
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">contains?</span>(<span class="ruby-identifier">account</span>)
493
- <span class="ruby-identifier">wallet_required!</span>
494
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_contains</span>, <span class="ruby-value">account:</span> <span class="ruby-identifier">account</span>)
495
- <span class="ruby-operator">!</span><span class="ruby-identifier">response</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:exists</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
496
- <span class="ruby-keyword">end</span></pre>
497
- </div>
498
- </div>
499
-
500
- </div>
501
-
502
- <div class="method">
503
- <div class="title method-title" id="method-i-create">
504
-
505
- <b>create</b>()
506
-
507
- <a href="../../classes/Nanook/Wallet.html#method-i-create" name="method-i-create" class="permalink">Link</a>
508
- </div>
509
-
510
-
511
- <div class="description">
512
-
513
- </div>
514
-
515
-
516
-
517
-
518
-
519
-
520
-
521
-
522
- <div class="sourcecode">
523
-
524
- <p class="source-link">
525
- Source:
526
- <a href="javascript:toggleSource('method-i-create_source')" id="l_method-i-create_source">show</a>
527
-
528
- </p>
529
- <div id="method-i-create_source" class="dyn-source">
530
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 28</span>
531
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>
532
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_create</span>)[<span class="ruby-value">:wallet</span>]
533
- <span class="ruby-keyword">end</span></pre>
534
- </div>
535
- </div>
536
-
537
- </div>
538
-
539
- <div class="method">
540
- <div class="title method-title" id="method-i-destroy">
541
-
542
- <b>destroy</b>()
543
-
544
- <a href="../../classes/Nanook/Wallet.html#method-i-destroy" name="method-i-destroy" class="permalink">Link</a>
545
- </div>
546
-
547
-
548
- <div class="description">
549
-
550
- </div>
551
-
552
-
553
-
554
-
555
-
556
-
557
-
558
-
559
- <div class="sourcecode">
560
-
561
- <p class="source-link">
562
- Source:
563
- <a href="javascript:toggleSource('method-i-destroy_source')" id="l_method-i-destroy_source">show</a>
564
-
565
- </p>
566
- <div id="method-i-destroy_source" class="dyn-source">
567
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 32</span>
568
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">destroy</span>
569
- <span class="ruby-identifier">wallet_required!</span>
570
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_destroy</span>)
571
- <span class="ruby-keyword">true</span>
572
- <span class="ruby-keyword">end</span></pre>
573
- </div>
574
- </div>
575
-
576
- </div>
577
-
578
- <div class="method">
579
- <div class="title method-title" id="method-i-export">
580
-
581
- <b>export</b>()
582
-
583
- <a href="../../classes/Nanook/Wallet.html#method-i-export" name="method-i-export" class="permalink">Link</a>
584
- </div>
585
-
586
-
587
- <div class="description">
588
- <p>Returns string of JSON</p>
589
- </div>
590
-
591
-
592
-
593
-
594
-
595
-
596
-
597
-
598
- <div class="sourcecode">
599
-
600
- <p class="source-link">
601
- Source:
602
- <a href="javascript:toggleSource('method-i-export_source')" id="l_method-i-export_source">show</a>
603
-
604
- </p>
605
- <div id="method-i-export_source" class="dyn-source">
606
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 39</span>
607
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">export</span>
608
- <span class="ruby-identifier">wallet_required!</span>
609
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_export</span>)[<span class="ruby-value">:json</span>]
610
- <span class="ruby-keyword">end</span></pre>
611
- </div>
612
- </div>
613
-
614
- </div>
615
-
616
- <div class="method">
617
- <div class="title method-title" id="method-i-locked-3F">
618
-
619
- <b>locked?</b>()
620
-
621
- <a href="../../classes/Nanook/Wallet.html#method-i-locked-3F" name="method-i-locked-3F" class="permalink">Link</a>
622
- </div>
623
-
624
-
625
- <div class="description">
626
-
627
- </div>
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
- <div class="sourcecode">
637
-
638
- <p class="source-link">
639
- Source:
640
- <a href="javascript:toggleSource('method-i-locked-3F_source')" id="l_method-i-locked-3F_source">show</a>
641
-
642
- </p>
643
- <div id="method-i-locked-3F_source" class="dyn-source">
644
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 62</span>
645
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">locked?</span>
646
- <span class="ruby-identifier">wallet_required!</span>
647
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:wallet_locked</span>)
648
- <span class="ruby-operator">!</span><span class="ruby-identifier">response</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:locked</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
649
- <span class="ruby-keyword">end</span></pre>
650
- </div>
651
- </div>
652
-
653
- </div>
654
-
655
- <div class="method">
656
- <div class="title method-title" id="method-i-pay">
657
-
658
- <b>pay</b>(from:, to:, amount:, id:)
659
-
660
- <a href="../../classes/Nanook/Wallet.html#method-i-pay" name="method-i-pay" class="permalink">Link</a>
661
- </div>
662
-
663
-
664
- <div class="description">
665
-
666
- </div>
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
- <div class="sourcecode">
676
-
677
- <p class="source-link">
678
- Source:
679
- <a href="javascript:toggleSource('method-i-pay_source')" id="l_method-i-pay_source">show</a>
680
-
681
- </p>
682
- <div id="method-i-pay_source" class="dyn-source">
683
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 50</span>
684
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pay</span>(<span class="ruby-value">from:</span>, <span class="ruby-value">to:</span>, <span class="ruby-value">amount:</span>, <span class="ruby-value">id:</span>)
685
- <span class="ruby-identifier">wallet_required!</span>
686
- <span class="ruby-identifier">validate_wallet_contains_account!</span>(<span class="ruby-identifier">from</span>)
687
- <span class="ruby-identifier">account</span>(<span class="ruby-identifier">from</span>).<span class="ruby-identifier">pay</span>(<span class="ruby-value">to:</span> <span class="ruby-identifier">to</span>, <span class="ruby-value">amount:</span> <span class="ruby-identifier">amount</span>, <span class="ruby-value">id:</span> <span class="ruby-identifier">id</span>)
688
- <span class="ruby-keyword">end</span></pre>
689
- </div>
690
- </div>
691
-
692
- </div>
693
-
694
- <div class="method">
695
- <div class="title method-title" id="method-i-receive">
696
-
697
- <b>receive</b>(block=nil, into:)
698
-
699
- <a href="../../classes/Nanook/Wallet.html#method-i-receive" name="method-i-receive" class="permalink">Link</a>
700
- </div>
701
-
702
-
703
- <div class="description">
704
-
705
- </div>
706
-
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
- <div class="sourcecode">
715
-
716
- <p class="source-link">
717
- Source:
718
- <a href="javascript:toggleSource('method-i-receive_source')" id="l_method-i-receive_source">show</a>
719
-
720
- </p>
721
- <div id="method-i-receive_source" class="dyn-source">
722
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 56</span>
723
- <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>, <span class="ruby-value">into:</span>)
724
- <span class="ruby-identifier">wallet_required!</span>
725
- <span class="ruby-identifier">validate_wallet_contains_account!</span>(<span class="ruby-identifier">into</span>)
726
- <span class="ruby-identifier">account</span>(<span class="ruby-identifier">into</span>).<span class="ruby-identifier">receive</span>(<span class="ruby-identifier">block</span>)
727
- <span class="ruby-keyword">end</span></pre>
728
- </div>
729
- </div>
730
-
731
- </div>
732
-
733
- <div class="method">
734
- <div class="title method-title" id="method-i-unlock">
735
-
736
- <b>unlock</b>(password)
737
-
738
- <a href="../../classes/Nanook/Wallet.html#method-i-unlock" name="method-i-unlock" class="permalink">Link</a>
739
- </div>
740
-
741
-
742
- <div class="description">
743
-
744
- </div>
745
-
746
-
747
-
748
-
749
-
750
-
751
-
752
-
753
- <div class="sourcecode">
754
-
755
- <p class="source-link">
756
- Source:
757
- <a href="javascript:toggleSource('method-i-unlock_source')" id="l_method-i-unlock_source">show</a>
758
-
759
- </p>
760
- <div id="method-i-unlock_source" class="dyn-source">
761
- <pre><span class="ruby-comment"># File lib/nanook/wallet.rb, line 68</span>
762
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unlock</span>(<span class="ruby-identifier">password</span>)
763
- <span class="ruby-identifier">wallet_required!</span>
764
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:password_enter</span>, <span class="ruby-value">password:</span> <span class="ruby-identifier">password</span>)[<span class="ruby-value">:valid</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
765
- <span class="ruby-keyword">end</span></pre>
766
- </div>
767
- </div>
768
-
769
- </div>
770
-
771
-
772
-
773
-
774
- </div>
775
-
776
- </div>
777
- </body>
778
- </html>