sword2ruby 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +30 -0
- data/LICENCE +35 -0
- data/README.md +43 -0
- data/Rakefile +53 -0
- data/doc/Atom/Collection.html +837 -0
- data/doc/Atom/Element.html +197 -0
- data/doc/Atom/Entry.html +1795 -0
- data/doc/Atom/Feed.html +297 -0
- data/doc/Atom/Service.html +363 -0
- data/doc/Atom.html +158 -0
- data/doc/Gemfile.html +125 -0
- data/doc/Object.html +165 -0
- data/doc/REXML/Element.html +493 -0
- data/doc/REXML.html +158 -0
- data/doc/Rakefile.html +123 -0
- data/doc/Sword2Ruby/Atom.html +169 -0
- data/doc/Sword2Ruby/AutoDiscover.html +327 -0
- data/doc/Sword2Ruby/Connection.html +274 -0
- data/doc/Sword2Ruby/DepositReceipt.html +331 -0
- data/doc/Sword2Ruby/Exception.html +168 -0
- data/doc/Sword2Ruby/SwordAccept.html +169 -0
- data/doc/Sword2Ruby/SwordStatementOAIORE.html +277 -0
- data/doc/Sword2Ruby/User.html +272 -0
- data/doc/Sword2Ruby/Utility.html +1101 -0
- data/doc/Sword2Ruby.html +213 -0
- data/doc/created.rid +29 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +118 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/spec/fixtures/example_txt.html +125 -0
- data/doc/table_of_contents.html +267 -0
- data/lib/sword2ruby/auto_discover.rb +71 -0
- data/lib/sword2ruby/collection.rb +261 -0
- data/lib/sword2ruby/connection.rb +37 -0
- data/lib/sword2ruby/constant.rb +35 -0
- data/lib/sword2ruby/deposit_receipt.rb +52 -0
- data/lib/sword2ruby/element.rb +12 -0
- data/lib/sword2ruby/entry.rb +602 -0
- data/lib/sword2ruby/exception.rb +7 -0
- data/lib/sword2ruby/feed.rb +34 -0
- data/lib/sword2ruby/rexml_element.rb +79 -0
- data/lib/sword2ruby/service.rb +79 -0
- data/lib/sword2ruby/sword_accept.rb +10 -0
- data/lib/sword2ruby/sword_statement_oai_ore.rb +38 -0
- data/lib/sword2ruby/user.rb +25 -0
- data/lib/sword2ruby/utility.rb +232 -0
- data/lib/sword2ruby/version.rb +4 -0
- data/lib/sword2ruby.rb +32 -0
- data/spec/auto_discover_spec.rb +30 -0
- data/spec/collection_spec.rb +33 -0
- data/spec/connection_spec.rb +21 -0
- data/spec/end_to_end_spec.rb +235 -0
- data/spec/fixtures/example.txt +3 -0
- data/spec/fixtures/snowflake.png +0 -0
- data/spec/fixtures/zip-test.zip +0 -0
- data/spec/service_spec.rb +38 -0
- data/spec/statement_spec.rb +53 -0
- data/spec/test_constants.rb +32 -0
- data/sword2ruby.gemspec +42 -0
- data/sword2ruby.tmproj +27 -0
- metadata +197 -0
@@ -0,0 +1,274 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Sword2Ruby::Connection - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/sword2ruby/connection.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Atom::HTTP
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</nav>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
<nav id="fileindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Pages</h3>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a>
|
89
|
+
|
90
|
+
<li class="file"><a href="../spec/fixtures/example_txt.html">example</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
<nav id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class and Module Index</h3>
|
97
|
+
|
98
|
+
<ul class="link-list">
|
99
|
+
|
100
|
+
<li><a href="../Sword2Ruby.html">Sword2Ruby</a>
|
101
|
+
|
102
|
+
<li><a href="../Sword2Ruby/Atom.html">Sword2Ruby::Atom</a>
|
103
|
+
|
104
|
+
<li><a href="../Sword2Ruby/AutoDiscover.html">Sword2Ruby::AutoDiscover</a>
|
105
|
+
|
106
|
+
<li><a href="../Sword2Ruby/Connection.html">Sword2Ruby::Connection</a>
|
107
|
+
|
108
|
+
<li><a href="../Sword2Ruby/DepositReceipt.html">Sword2Ruby::DepositReceipt</a>
|
109
|
+
|
110
|
+
<li><a href="../Sword2Ruby/Exception.html">Sword2Ruby::Exception</a>
|
111
|
+
|
112
|
+
<li><a href="../Sword2Ruby/SwordAccept.html">Sword2Ruby::SwordAccept</a>
|
113
|
+
|
114
|
+
<li><a href="../Sword2Ruby/SwordStatementOAIORE.html">Sword2Ruby::SwordStatementOAIORE</a>
|
115
|
+
|
116
|
+
<li><a href="../Sword2Ruby/User.html">Sword2Ruby::User</a>
|
117
|
+
|
118
|
+
<li><a href="../Sword2Ruby/Utility.html">Sword2Ruby::Utility</a>
|
119
|
+
|
120
|
+
<li><a href="../Atom.html">Atom</a>
|
121
|
+
|
122
|
+
<li><a href="../Atom/Collection.html">Atom::Collection</a>
|
123
|
+
|
124
|
+
<li><a href="../Atom/Element.html">Atom::Element</a>
|
125
|
+
|
126
|
+
<li><a href="../Atom/Entry.html">Atom::Entry</a>
|
127
|
+
|
128
|
+
<li><a href="../Atom/Feed.html">Atom::Feed</a>
|
129
|
+
|
130
|
+
<li><a href="../Atom/Service.html">Atom::Service</a>
|
131
|
+
|
132
|
+
<li><a href="../REXML.html">REXML</a>
|
133
|
+
|
134
|
+
<li><a href="../REXML/Element.html">REXML::Element</a>
|
135
|
+
|
136
|
+
<li><a href="../Object.html">Object</a>
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
</nav>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</nav>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="class">class Sword2Ruby::Connection</h1>
|
146
|
+
|
147
|
+
<div id="description" class="description">
|
148
|
+
|
149
|
+
<p>The <a href="Connection.html">Connection</a> class inherits from the
|
150
|
+
Atom::HTTP class to ensure authentication credentials are used on Sword
|
151
|
+
operations.</p>
|
152
|
+
|
153
|
+
<p>Please see the <a
|
154
|
+
href="http://rdoc.info/github/bct/atom-tools/master/frames">atom-tools
|
155
|
+
documentation</a> for a complete list of attributes and methods (including
|
156
|
+
post, get, put, delete etc).</p>
|
157
|
+
|
158
|
+
</div><!-- description -->
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<!-- Attributes -->
|
172
|
+
<section id="attribute-method-details" class="method-section section">
|
173
|
+
<h3 class="section-header">Attributes</h3>
|
174
|
+
|
175
|
+
|
176
|
+
<div id="attribute-i-use_authentication" class="method-detail">
|
177
|
+
<div class="method-heading attribute-method-heading">
|
178
|
+
<span class="method-name">use_authentication</span><span
|
179
|
+
class="attribute-access-type">[R]</span>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div class="method-description">
|
183
|
+
|
184
|
+
<p>Boolean value indicating whether authentication is used</p>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div id="attribute-i-user_credentials" class="method-detail">
|
190
|
+
<div class="method-heading attribute-method-heading">
|
191
|
+
<span class="method-name">user_credentials</span><span
|
192
|
+
class="attribute-access-type">[R]</span>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
|
197
|
+
<p>The <a href="User.html">Sword2Ruby::User</a> credentials object this
|
198
|
+
connection is using, or nil for anonymous communication</p>
|
199
|
+
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
</section><!-- attribute-method-details -->
|
204
|
+
|
205
|
+
|
206
|
+
<!-- Methods -->
|
207
|
+
|
208
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
209
|
+
<h3 class="section-header">Public Class Methods</h3>
|
210
|
+
|
211
|
+
|
212
|
+
<div id="method-c-new" class="method-detail ">
|
213
|
+
|
214
|
+
<div class="method-heading">
|
215
|
+
<span class="method-name">new</span><span
|
216
|
+
class="method-args">(user_credentials = nil)</span>
|
217
|
+
<span class="method-click-advice">click to toggle source</span>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
|
223
|
+
<p>Creates a new <a href="Connection.html">Connection</a> object</p>
|
224
|
+
|
225
|
+
<h3 id="method-c-new-label-Parameters">Parameters</h3>
|
226
|
+
<dl class="rdoc-list note-list"><dt><a href="Connection.html#attribute-i-user_credentials">#user_credentials</a>
|
227
|
+
<dd>
|
228
|
+
<p>(optional) a <a href="User.html">Sword2Ruby::User</a> object with the
|
229
|
+
username and password</p>
|
230
|
+
</dd></dl>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-source-code" id="new-source">
|
235
|
+
<pre><span class="ruby-comment"># File lib/sword2ruby/connection.rb, line 19</span>
|
236
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">user_credentials</span> = <span class="ruby-keyword">nil</span>)
|
237
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">user_credentials</span>.<span class="ruby-identifier">nil?</span>
|
238
|
+
<span class="ruby-constant">Utility</span>.<span class="ruby-identifier">check_argument_class</span>(<span class="ruby-string">'user_credentials'</span>, <span class="ruby-identifier">user_credentials</span>, <span class="ruby-constant">User</span>)
|
239
|
+
<span class="ruby-keyword">end</span>
|
240
|
+
<span class="ruby-ivar">@user_credentials</span> = <span class="ruby-identifier">user_credentials</span>
|
241
|
+
<span class="ruby-ivar">@use_authentication</span> = <span class="ruby-ivar">@user_credentials</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@user_credentials</span>.<span class="ruby-identifier">username</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@user_credentials</span>.<span class="ruby-identifier">password</span>
|
242
|
+
|
243
|
+
<span class="ruby-keyword">super</span>() <span class="ruby-comment">#initialize the base (Atom::HTTP) class</span>
|
244
|
+
|
245
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@use_authentication</span>
|
246
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">user</span> = <span class="ruby-ivar">@user_credentials</span>.<span class="ruby-identifier">username</span>
|
247
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">pass</span> = <span class="ruby-ivar">@user_credentials</span>.<span class="ruby-identifier">password</span>
|
248
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">always_auth</span> = <span class="ruby-value">:basic</span>
|
249
|
+
<span class="ruby-keyword">end</span>
|
250
|
+
|
251
|
+
<span class="ruby-keyword">end</span></pre>
|
252
|
+
</div><!-- new-source -->
|
253
|
+
|
254
|
+
</div>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</div><!-- new-method -->
|
260
|
+
|
261
|
+
|
262
|
+
</section><!-- public-class-method-details -->
|
263
|
+
|
264
|
+
</section><!-- 5Buntitled-5D -->
|
265
|
+
|
266
|
+
</div><!-- documentation -->
|
267
|
+
|
268
|
+
|
269
|
+
<footer id="validator-badges">
|
270
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
271
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
272
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
273
|
+
</footer>
|
274
|
+
|
@@ -0,0 +1,331 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Sword2Ruby::DepositReceipt - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/sword2ruby/deposit_receipt.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link"><a href="../Object.html">Object</a>
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-c-new">::new</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</nav>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
<nav id="fileindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Pages</h3>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a>
|
89
|
+
|
90
|
+
<li class="file"><a href="../spec/fixtures/example_txt.html">example</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
<nav id="classindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Class and Module Index</h3>
|
97
|
+
|
98
|
+
<ul class="link-list">
|
99
|
+
|
100
|
+
<li><a href="../Sword2Ruby.html">Sword2Ruby</a>
|
101
|
+
|
102
|
+
<li><a href="../Sword2Ruby/Atom.html">Sword2Ruby::Atom</a>
|
103
|
+
|
104
|
+
<li><a href="../Sword2Ruby/AutoDiscover.html">Sword2Ruby::AutoDiscover</a>
|
105
|
+
|
106
|
+
<li><a href="../Sword2Ruby/Connection.html">Sword2Ruby::Connection</a>
|
107
|
+
|
108
|
+
<li><a href="../Sword2Ruby/DepositReceipt.html">Sword2Ruby::DepositReceipt</a>
|
109
|
+
|
110
|
+
<li><a href="../Sword2Ruby/Exception.html">Sword2Ruby::Exception</a>
|
111
|
+
|
112
|
+
<li><a href="../Sword2Ruby/SwordAccept.html">Sword2Ruby::SwordAccept</a>
|
113
|
+
|
114
|
+
<li><a href="../Sword2Ruby/SwordStatementOAIORE.html">Sword2Ruby::SwordStatementOAIORE</a>
|
115
|
+
|
116
|
+
<li><a href="../Sword2Ruby/User.html">Sword2Ruby::User</a>
|
117
|
+
|
118
|
+
<li><a href="../Sword2Ruby/Utility.html">Sword2Ruby::Utility</a>
|
119
|
+
|
120
|
+
<li><a href="../Atom.html">Atom</a>
|
121
|
+
|
122
|
+
<li><a href="../Atom/Collection.html">Atom::Collection</a>
|
123
|
+
|
124
|
+
<li><a href="../Atom/Element.html">Atom::Element</a>
|
125
|
+
|
126
|
+
<li><a href="../Atom/Entry.html">Atom::Entry</a>
|
127
|
+
|
128
|
+
<li><a href="../Atom/Feed.html">Atom::Feed</a>
|
129
|
+
|
130
|
+
<li><a href="../Atom/Service.html">Atom::Service</a>
|
131
|
+
|
132
|
+
<li><a href="../REXML.html">REXML</a>
|
133
|
+
|
134
|
+
<li><a href="../REXML/Element.html">REXML::Element</a>
|
135
|
+
|
136
|
+
<li><a href="../Object.html">Object</a>
|
137
|
+
|
138
|
+
</ul>
|
139
|
+
</nav>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</nav>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="class">class Sword2Ruby::DepositReceipt</h1>
|
146
|
+
|
147
|
+
<div id="description" class="description">
|
148
|
+
|
149
|
+
<p>The <a href="DepositReceipt.html">DepositReceipt</a> object is returned
|
150
|
+
following Post, Put and Delete operations on the Sword server. In some
|
151
|
+
cases (e.g. Post), an <a href="../Atom/Entry.html">Atom::Entry</a> will
|
152
|
+
usually be returned describing the newly created entry. Operations such as
|
153
|
+
Delete do not return an <a href="../Atom/Entry.html">Atom::Entry</a>. If
|
154
|
+
the Sword server does not automatically return the <a
|
155
|
+
href="../Atom/Entry.html">Atom::Entry</a> but instead provides a link to
|
156
|
+
it, the <a href="DepositReceipt.html">DepositReceipt</a> object will
|
157
|
+
automatically fetch it.</p>
|
158
|
+
|
159
|
+
<p>For more information, see the Sword2 specification: <a
|
160
|
+
href="http://sword-app.svn.sourceforge.net/viewvc/sword-app/spec/tags/sword-2.0/SWORDProfile.html?revision=377#depositreceipt">section
|
161
|
+
10 “Deposit Receipt”</a>.</p>
|
162
|
+
|
163
|
+
</div><!-- description -->
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<!-- Attributes -->
|
177
|
+
<section id="attribute-method-details" class="method-section section">
|
178
|
+
<h3 class="section-header">Attributes</h3>
|
179
|
+
|
180
|
+
|
181
|
+
<div id="attribute-i-entry" class="method-detail">
|
182
|
+
<div class="method-heading attribute-method-heading">
|
183
|
+
<span class="method-name">entry</span><span
|
184
|
+
class="attribute-access-type">[R]</span>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
|
189
|
+
<p>The <a href="../Atom/Entry.html">Atom::Entry</a> associated with this
|
190
|
+
receipt, or nil if not supplied. The <a
|
191
|
+
href="../Atom/Entry.html">Atom::Entry</a> will be automatically fetched
|
192
|
+
from the server when necessary.</p>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div id="attribute-i-has_entry" class="method-detail">
|
198
|
+
<div class="method-heading attribute-method-heading">
|
199
|
+
<span class="method-name">has_entry</span><span
|
200
|
+
class="attribute-access-type">[R]</span>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div class="method-description">
|
204
|
+
|
205
|
+
<p>Boolean value indicating whether there is an <a
|
206
|
+
href="../Atom/Entry.html">Atom::Entry</a> associated with this receipt.</p>
|
207
|
+
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="attribute-i-location" class="method-detail">
|
212
|
+
<div class="method-heading attribute-method-heading">
|
213
|
+
<span class="method-name">location</span><span
|
214
|
+
class="attribute-access-type">[R]</span>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div class="method-description">
|
218
|
+
|
219
|
+
<p>The location header returned by the Sword server, usually after Posting or
|
220
|
+
Putting.</p>
|
221
|
+
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div id="attribute-i-status_code" class="method-detail">
|
226
|
+
<div class="method-heading attribute-method-heading">
|
227
|
+
<span class="method-name">status_code</span><span
|
228
|
+
class="attribute-access-type">[R]</span>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
|
233
|
+
<p>The http status code returned by the Sword server.</p>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="attribute-i-status_message" class="method-detail">
|
239
|
+
<div class="method-heading attribute-method-heading">
|
240
|
+
<span class="method-name">status_message</span><span
|
241
|
+
class="attribute-access-type">[R]</span>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
|
246
|
+
<p>The http status message returned by the Sword server.</p>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</section><!-- attribute-method-details -->
|
252
|
+
|
253
|
+
|
254
|
+
<!-- Methods -->
|
255
|
+
|
256
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
257
|
+
<h3 class="section-header">Public Class Methods</h3>
|
258
|
+
|
259
|
+
|
260
|
+
<div id="method-c-new" class="method-detail ">
|
261
|
+
|
262
|
+
<div class="method-heading">
|
263
|
+
<span class="method-name">new</span><span
|
264
|
+
class="method-args">(response, connection)</span>
|
265
|
+
<span class="method-click-advice">click to toggle source</span>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
|
269
|
+
<div class="method-description">
|
270
|
+
|
271
|
+
<p>Create a new <a href="DepositReceipt.html">DepositReceipt</a> using the
|
272
|
+
Response object returned by the server.</p>
|
273
|
+
|
274
|
+
<h3 id="method-c-new-label-Parameters">Parameters</h3>
|
275
|
+
<dl class="rdoc-list note-list"><dt>response
|
276
|
+
<dd>
|
277
|
+
<p>the response object returned by the request</p>
|
278
|
+
</dd><dt>connection
|
279
|
+
<dd>
|
280
|
+
<p>a <a href="Connection.html">Sword2Ruby::Connection</a> object</p>
|
281
|
+
</dd></dl>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
<div class="method-source-code" id="new-source">
|
286
|
+
<pre><span class="ruby-comment"># File lib/sword2ruby/deposit_receipt.rb, line 28</span>
|
287
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">connection</span>)
|
288
|
+
<span class="ruby-ivar">@location</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>[<span class="ruby-string">"location"</span>]
|
289
|
+
<span class="ruby-ivar">@status_code</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>
|
290
|
+
<span class="ruby-ivar">@status_message</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">message</span>
|
291
|
+
|
292
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>
|
293
|
+
<span class="ruby-comment">#If a receipt was returned, parse it</span>
|
294
|
+
<span class="ruby-ivar">@entry</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>)
|
295
|
+
<span class="ruby-ivar">@entry</span>.<span class="ruby-identifier">http</span> = <span class="ruby-identifier">connection</span>
|
296
|
+
<span class="ruby-ivar">@has_entry</span> = <span class="ruby-keyword">true</span>
|
297
|
+
<span class="ruby-keyword">else</span>
|
298
|
+
<span class="ruby-comment">#if the receipt was not returned, try and retrieve it</span>
|
299
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@location</span>
|
300
|
+
<span class="ruby-ivar">@entry</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">get</span>(<span class="ruby-ivar">@location</span>).<span class="ruby-identifier">body</span>)
|
301
|
+
<span class="ruby-ivar">@has_entry</span> = <span class="ruby-keyword">true</span>
|
302
|
+
<span class="ruby-keyword">else</span>
|
303
|
+
<span class="ruby-comment">#Otherwise, there is no receipt (e.g. for a delete)</span>
|
304
|
+
<span class="ruby-ivar">@has_entry</span> = <span class="ruby-keyword">false</span>
|
305
|
+
<span class="ruby-ivar">@entry</span> = <span class="ruby-keyword">nil</span>
|
306
|
+
<span class="ruby-keyword">end</span>
|
307
|
+
<span class="ruby-keyword">end</span>
|
308
|
+
<span class="ruby-keyword">end</span></pre>
|
309
|
+
</div><!-- new-source -->
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</div><!-- new-method -->
|
317
|
+
|
318
|
+
|
319
|
+
</section><!-- public-class-method-details -->
|
320
|
+
|
321
|
+
</section><!-- 5Buntitled-5D -->
|
322
|
+
|
323
|
+
</div><!-- documentation -->
|
324
|
+
|
325
|
+
|
326
|
+
<footer id="validator-badges">
|
327
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
328
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
329
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
330
|
+
</footer>
|
331
|
+
|