iii 0.1 → 0.1.1

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.
Files changed (6) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/Rakefile +2 -1
  3. data/iii.rb +118 -118
  4. data/index.html +38 -39
  5. data/test_iii.rb +2 -4
  6. metadata +14 -4
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2006 Aaron J. Bedra aaron@aaronbedra.com
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/Rakefile CHANGED
@@ -16,8 +16,9 @@ Rake::RDocTask.new { |rdoc|
16
16
  }
17
17
 
18
18
  spec = Gem::Specification.new do |s|
19
+ s.add_dependency('rubyful_soup', '>= 1.0.4')
19
20
  s.name = 'iii'
20
- s.version = "0.1"
21
+ s.version = "0.1.1"
21
22
  s.platform = Gem::Platform::RUBY
22
23
  s.summary = "A Simplified way to access the Innovative Interfaces Patron API written by Aaron Bedra"
23
24
  s.files = Dir.glob("*").delete_if { |item| item.include?("svn") }
data/iii.rb CHANGED
@@ -12,7 +12,7 @@ class Patron
12
12
  catalog = catalog
13
13
  barcode = barcode
14
14
  @patron = "http://#{catalog}:4500/PATRONAPI/#{barcode}/dump"
15
-
15
+ @data = get_data
16
16
  end
17
17
 
18
18
  def get_data
@@ -27,275 +27,275 @@ class Patron
27
27
  return data
28
28
  end
29
29
 
30
- def rec_info(data)
31
- if !data.nil?
32
- rec_info = data[0]
30
+ def rec_info
31
+ if !@data.nil?
32
+ rec_info = data[0].split("=").last
33
33
  return rec_info
34
34
  end
35
35
  end
36
36
 
37
- def exp_date(data)
38
- if !data.nil?
39
- exp_date = data[1]
37
+ def exp_date
38
+ if !@data.nil?
39
+ exp_date = data[1].split("=").last
40
40
  return exp_date
41
41
  end
42
42
  end
43
43
 
44
- def age_range(data)
45
- if !data.nil?
46
- age_range = data[2]
44
+ def age_range
45
+ if !@data.nil?
46
+ age_range = data[2].split("=").last
47
47
  return age_range
48
48
  end
49
49
  end
50
50
 
51
- def county(data)
52
- if !data.nil?
53
- county = data[3]
51
+ def county
52
+ if !@data.nil?
53
+ county = data[3].split("=").last
54
54
  return county
55
55
  end
56
56
  end
57
57
 
58
- def sch_dist(data)
59
- if !data.nil?
60
- sch_dist = data[4]
58
+ def sch_dist
59
+ if !@data.nil?
60
+ sch_dist = data[4].split("=").last
61
61
  return sch_dist
62
62
  end
63
63
  end
64
64
 
65
- def ptype(data)
66
- if !data.nil?
67
- ptype = data[5]
65
+ def ptype
66
+ if !@data.nil?
67
+ ptype = data[5].split("=").last
68
68
  return ptype
69
69
  end
70
70
  end
71
71
 
72
- def tot_chkout(data)
73
- if !data.nil?
74
- tot_chkout = data[6]
72
+ def tot_chkout
73
+ if !@data.nil?
74
+ tot_chkout = data[6].split("=").last
75
75
  return tot_chkout
76
76
  end
77
77
  end
78
78
 
79
- def tot_renewal(data)
80
- if !data.nil?
81
- tot_renewal = data[7]
79
+ def tot_renewal
80
+ if !@data.nil?
81
+ tot_renewal = data[7].split("=").last
82
82
  return tot_renewal
83
83
  end
84
84
  end
85
85
 
86
- def cur_chkout(data)
87
- if !data.nil?
88
- cur_chkout = data[8]
86
+ def cur_chkout
87
+ if !@data.nil?
88
+ cur_chkout = data[8].split("=").last
89
89
  return cur_chkout
90
90
  end
91
91
  end
92
92
 
93
- def home_libr(data)
94
- if !data.nil?
95
- home_libr = data[9]
93
+ def home_libr
94
+ if !@data.nil?
95
+ home_libr = data[9].split("=").last
96
96
  return home_libr
97
97
  end
98
98
  end
99
99
 
100
- def pmessage(data)
101
- if !data.nil?
102
- pmessage = data[10]
100
+ def pmessage
101
+ if !@data.nil?
102
+ pmessage = data[10].split("=").last
103
103
  return pmessage
104
104
  end
105
105
  end
106
106
 
107
- def mblock(data)
108
- if !data.nil?
109
- mblock = data[11]
107
+ def mblock
108
+ if !@data.nil?
109
+ mblock = data[11].split("=").last
110
110
  return mblock
111
111
  end
112
112
  end
113
113
 
114
- def rec_type(data)
115
- if !data.nil?
116
- rec_type = data[12]
114
+ def rec_type
115
+ if !@data.nil?
116
+ rec_type = data[12].split("=").last
117
117
  return rec_type
118
118
  end
119
119
  end
120
120
 
121
- def record(data)
122
- if !data.nil?
123
- record = data[13]
121
+ def record
122
+ if !@data.nil?
123
+ record = data[13].split("=").last
124
124
  return record
125
125
  end
126
126
  end
127
127
 
128
- def rec_leng(data)
129
- if !data.nil?
130
- rec_leng = data[14]
128
+ def rec_leng
129
+ if !@data.nil?
130
+ rec_leng = data[14].split("=").last
131
131
  return rec_leng
132
132
  end
133
133
  end
134
134
 
135
- def created(data)
136
- if !data.nil?
137
- created = data[15]
135
+ def created
136
+ if !@data.nil?
137
+ created = data[15].split("=").last
138
138
  return created
139
139
  end
140
140
  end
141
141
 
142
- def updated(data)
143
- if !data.nil?
144
- updated = data[16]
142
+ def updated
143
+ if !@data.nil?
144
+ updated = data[16].split("=").last
145
145
  return updated
146
146
  end
147
147
  end
148
148
 
149
- def revisions(data)
150
- if !data.nil?
151
- revisions = data[17]
149
+ def revisions
150
+ if !@data.nil?
151
+ revisions = data[17].split("=").last
152
152
  return revisions
153
153
  end
154
154
  end
155
155
 
156
- def agency(data)
157
- if !data.nil?
158
- agency = data[18]
156
+ def agency
157
+ if !@data.nil?
158
+ agency = data[18].split("=").last
159
159
  return agency
160
160
  end
161
161
  end
162
162
 
163
- def cl_rtrnd(data)
164
- if !data.nil?
165
- cl_rtrnd = data[19]
163
+ def cl_rtrnd
164
+ if !@data.nil?
165
+ cl_rtrnd = data[19].split("=").last
166
166
  return cl_rtrnd
167
167
  end
168
168
  end
169
169
 
170
- def money_owed(data)
171
- if !data.nil?
172
- money_owed = data[20]
170
+ def money_owed
171
+ if !@data.nil?
172
+ money_owed = data[20].split("=").last
173
173
  return money_owed
174
174
  end
175
175
  end
176
176
 
177
- def blk_until(data)
178
- if !data.nil?
179
- blk_until = data[21]
177
+ def blk_until
178
+ if !@data.nil?
179
+ blk_until = data[21].split("=").last
180
180
  return blk_until
181
181
  end
182
182
  end
183
183
 
184
- def cur_itema(data)
185
- if !data.nil?
186
- cur_itema = data[22]
184
+ def cur_itema
185
+ if !@data.nil?
186
+ cur_itema = data[22].split("=").last
187
187
  return cur_itema
188
188
  end
189
189
  end
190
190
 
191
- def cur_itemb(data)
192
- if !data.nil?
193
- cur_itemb = data[23]
191
+ def cur_itemb
192
+ if !@data.nil?
193
+ cur_itemb = data[23].split("=").last
194
194
  return cur_itemb
195
195
  end
196
196
  end
197
197
 
198
- def od_penalty(data)
199
- if !data.nil?
200
- od_penalty = data[24]
198
+ def od_penalty
199
+ if !@data.nil?
200
+ od_penalty = data[24].split("=").last
201
201
  return od_penalty
202
202
  end
203
203
  end
204
204
 
205
- def ill_reques(data)
206
- if !data.nil?
207
- ill_reques = data[25]
205
+ def ill_reques
206
+ if !@data.nil?
207
+ ill_reques = data[25].split("=").last
208
208
  return ill_reques
209
209
  end
210
210
  end
211
211
 
212
- def cur_itemc(data)
213
- if !data.nil?
214
- cur_itemc = data[26]
212
+ def cur_itemc
213
+ if !@data.nil?
214
+ cur_itemc = data[26].split("=").last
215
215
  return cur_itemc
216
216
  end
217
217
  end
218
218
 
219
- def cur_itemd(data)
220
- if !data.nil?
221
- cur_itemd = data[27]
219
+ def cur_itemd
220
+ if !@data.nil?
221
+ cur_itemd = data[27].split("=").last
222
222
  return cur_itemd
223
223
  end
224
224
  end
225
225
 
226
- def circactive(data)
227
- if !data.nil?
228
- circactive = data[28]
226
+ def circactive
227
+ if !@data.nil?
228
+ circactive = data[28].split("=").last
229
229
  return circactive
230
230
  end
231
231
  end
232
232
 
233
- def lang_pref(data)
234
- if !data.nil?
235
- lang_pref = data[29]
233
+ def lang_pref
234
+ if !@data.nil?
235
+ lang_pref = data[29].split("=").last
236
236
  return lang_pref
237
237
  end
238
238
  end
239
239
 
240
- def notice_pref(data)
241
- if !data.nil?
242
- notice_pref = data[30]
240
+ def notice_pref
241
+ if !@data.nil?
242
+ notice_pref = data[30].split("=").last
243
243
  return notice_pref
244
244
  end
245
245
  end
246
246
 
247
- def cur_regist(data)
248
- if !data.nil?
249
- cur_regist = data[31]
247
+ def cur_regist
248
+ if !@data.nil?
249
+ cur_regist = data[31].split("=").last
250
250
  return cur_regist
251
251
  end
252
252
  end
253
253
 
254
- def tot_regist(data)
255
- if !data.nil?
256
- tot_regist = data[32]
254
+ def tot_regist
255
+ if !@data.nil?
256
+ tot_regist = data[32].split("=").last
257
257
  return tot_regist
258
258
  end
259
259
  end
260
260
 
261
- def tot_attend(data)
262
- if !data.nil?
263
- tot_attend = data[33]
261
+ def tot_attend
262
+ if !@data.nil?
263
+ tot_attend = data[33].split("=").last
264
264
  return tot_attend
265
265
  end
266
266
  end
267
267
 
268
- def patrn_name(data)
269
- if !data.nil?
270
- patrn_name = data[34]
268
+ def patrn_name
269
+ if !@data.nil?
270
+ patrn_name = data[34].split("=").last
271
271
  return patrn_name
272
272
  end
273
273
  end
274
274
 
275
- def address(data)
276
- if !data.nil?
277
- address = data[35]
275
+ def address
276
+ if !@data.nil?
277
+ address = data[35].split("=").last
278
278
  return address
279
279
  end
280
280
  end
281
281
 
282
- def telephone(data)
283
- if !data.nil?
284
- telephone = data[36]
282
+ def telephone
283
+ if !@data.nil?
284
+ telephone = data[36].split("=").last
285
285
  return telephone
286
286
  end
287
287
  end
288
288
 
289
- def p_barcode(data)
290
- if !data.nil?
291
- p_barcode = data[37]
289
+ def p_barcode
290
+ if !@data.nil?
291
+ p_barcode = data[37].split("=").last
292
292
  return p_barcode
293
293
  end
294
294
  end
295
295
 
296
- def email_addr(data)
297
- if !data.nil?
298
- email_addr = data[38]
296
+ def email_addr
297
+ if !@data.nil?
298
+ email_addr = data[38].split("=").last
299
299
  return email_addr
300
300
  end
301
301
  end
data/index.html CHANGED
@@ -59,45 +59,44 @@
59
59
  <p><pre><code>require 'iii'
60
60
 
61
61
  <span># basics</span>
62
- patron = Patron.new(catalog, barcode) <span># Create a III Patron specific connection</span>
63
- data = patron.get_data <span># Retrieves the Patron's account information to an array</span>
64
- record_info = patron.rec_info(data) <span># Retrieves the Patron's record info</span>
65
- expiration_date = patron.exp_date(data) <span># Retrieves the Patron's account expiration date</span>
66
- age_range = patron.age_range(data) <span># Retrieves the Patron's age range type</span>
67
- county = patron.county(data) <span># Retrieves the Patron's county</span>
68
- school_district = patron.sch_dist(data) <span># Retrieves the Patron's school district if applicable</span>
69
- patron_type = patron.ptype(data) <span># Retrieves the Patron's patron type</span>
70
- total_checkouts = patron.tot_chkout(data) <span># Retrieves the total number of items checked out</span>
71
- total_renewals = patron.tot_renewal(data) <span># Retrieves the Patron's total renewals</span>
72
- current_checkouts = patron.cur_chkout(data) <span># Retrieves the number of current items checked out</span>
73
- home_library = patron.home_libr(data) <span># Retrieves the Patron's home library</span>
74
- patron_message = patron.pmessage(data) <span># Retrieves the any messages on the patron's account</span>
75
- block = patron.mblock(data) <span># Retrieves any block information</span>
76
- record_type = patron.rec_type(data) <span># Retrieves the Patron's record type</span>
77
- record = patron.record(data) <span># Retrieves the Patron's record information</span>
78
- record_length = patron.rec_leng(data) <span># Retrieves the Patron's record length</span>
79
- created = patron.created(data) <span># Retrieves the Patron's account creation date</span>
80
- updated = patron.updated(data) <span># Retrieves the Patron's account updated date</span>
81
- revisions = patron.revisions(data) <span># Retrieves the number of revisions on an account</span>
82
- agency = patron.agency(data) <span># Retrieves agency data</span>
83
- calls = patron.cl_rtrnd(data) <span># Retrieves call data</span>
84
- fines = patron.money_owed(data) <span># Retrieves the Patron's fine data</span>
85
- block_until = patron.blk_until(data) <span># Retrieves extra block information</span>
86
- itema = patron.cur_itema(data) <span># Retrieves specific item information</span>
87
- itemb = patron.cur_itemb(data) <span># Retrieves specific item information</span>
88
- itemc = patron.cur_itemc(data) <span># Retrieves specific item information</span>
89
- itemd = patron.cur_itemd(data) <span># Retrieves specific item information</span>
90
- illiad_requests = patron.ill_reques(data) <span># Retrieves illiad request information</span>
91
- circactive = patron.circactive(data) <span># ???</span>
92
- locale = patron.lang_pref(data) <span># Retrieves the Patron's language preference</span>
93
- notice_type = patron.notice_pref(data) <span># Retrieves the Patron's preferred notice type</span>
94
- current_reg = patron.cur_regist(data) <span># Retrieves the Patron's current event registrations</span>
95
- total_attendance = patron.tot_attend(data) <span># Retrieves the Patron's total event attendance</span>
96
- patron_name = patron.patrn_name(data) <span># Retrieves the Patron's name</span>
97
- address = patron.address(data) <span># Retrieves the Patron's address</span>
98
- phone = patron.telephone(data) <span># Retrieves the Patron's phone</span>
99
- barcode = patron.p_barcode(data) <span># Retrieves the Patron's barcode</span>
100
- email = patron.email_addr(data) <span># Retrieves the Patron's email address</span>
62
+ patron = Patron.new(catalog, barcode) <span># Create a III Patron specific connection</span>
63
+ record_info = patron.rec_info <span># Retrieves the Patron's record info</span>
64
+ expiration_date = patron.exp_date <span># Retrieves the Patron's account expiration date</span>
65
+ age_range = patron.age_range <span># Retrieves the Patron's age range type</span>
66
+ county = patron.county <span># Retrieves the Patron's county</span>
67
+ school_district = patron.sch_dist <span># Retrieves the Patron's school district if applicable</span>
68
+ patron_type = patron.ptype <span># Retrieves the Patron's patron type</span>
69
+ total_checkouts = patron.tot_chkout <span># Retrieves the total number of items checked out</span>
70
+ total_renewals = patron.tot_renewal <span># Retrieves the Patron's total renewals</span>
71
+ current_checkouts = patron.cur_chkout <span># Retrieves the number of current items checked out</span>
72
+ home_library = patron.home_libr <span># Retrieves the Patron's home library</span>
73
+ patron_message = patron.pmessage <span># Retrieves the any messages on the patron's account</span>
74
+ block = patron.mblock <span># Retrieves any block information</span>
75
+ record_type = patron.rec_type <span># Retrieves the Patron's record type</span>
76
+ record = patron.record <span># Retrieves the Patron's record information</span>
77
+ record_length = patron.rec_leng <span># Retrieves the Patron's record length</span>
78
+ created = patron.created <span># Retrieves the Patron's account creation date</span>
79
+ updated = patron.updated <span># Retrieves the Patron's account updated date</span>
80
+ revisions = patron.revisions <span># Retrieves the number of revisions on an account</span>
81
+ agency = patron.agency <span># Retrieves agency data</span>
82
+ calls = patron.cl_rtrnd <span># Retrieves call data</span>
83
+ fines = patron.money_owed <span># Retrieves the Patron's fine data</span>
84
+ block_until = patron.blk_until <span># Retrieves extra block information</span>
85
+ itema = patron.cur_itema <span># Retrieves specific item information</span>
86
+ itemb = patron.cur_itemb <span># Retrieves specific item information</span>
87
+ itemc = patron.cur_itemc <span># Retrieves specific item information</span>
88
+ itemd = patron.cur_itemd <span># Retrieves specific item information</span>
89
+ illiad_requests = patron.ill_reques <span># Retrieves illiad request information</span>
90
+ circactive = patron.circactive <span># ???</span>
91
+ locale = patron.lang_pref <span># Retrieves the Patron's language preference</span>
92
+ notice_type = patron.notice_pref <span># Retrieves the Patron's preferred notice type</span>
93
+ current_reg = patron.cur_regist <span># Retrieves the Patron's current event registrations</span>
94
+ total_attendance = patron.tot_attend <span># Retrieves the Patron's total event attendance</span>
95
+ patron_name = patron.patrn_name <span># Retrieves the Patron's name</span>
96
+ address = patron.address <span># Retrieves the Patron's address</span>
97
+ phone = patron.telephone <span># Retrieves the Patron's phone</span>
98
+ barcode = patron.p_barcode <span># Retrieves the Patron's barcode</span>
99
+ email = patron.email_addr <span># Retrieves the Patron's email address</span>
101
100
  </code></pre></p>
102
101
  </div>
103
102
 
@@ -9,11 +9,9 @@ class TestIII < Test::Unit::TestCase
9
9
  @patron = Patron.new(catalog, barcode)
10
10
  end
11
11
 
12
- def test_get_data
13
- data = @patron.get_data
14
-
12
+ def test_creation
15
13
  assert_not_nil @patron
16
- assert_not_nil data
14
+ assert_not_nil @data
17
15
  end
18
16
 
19
17
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: iii
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.1"
7
- date: 2006-07-20 00:00:00 -04:00
6
+ version: 0.1.1
7
+ date: 2006-07-25 00:00:00 -04:00
8
8
  summary: A Simplified way to access the Innovative Interfaces Patron API written by Aaron Bedra
9
9
  require_paths:
10
10
  - .
@@ -30,6 +30,8 @@ authors:
30
30
  files:
31
31
  - iii.rb
32
32
  - index.html
33
+ - MIT-LICENSE
34
+ - pkg
33
35
  - Rakefile
34
36
  - test_iii.rb
35
37
  test_files: []
@@ -44,5 +46,13 @@ extensions: []
44
46
 
45
47
  requirements: []
46
48
 
47
- dependencies: []
48
-
49
+ dependencies:
50
+ - !ruby/object:Gem::Dependency
51
+ name: rubyful_soup
52
+ version_requirement:
53
+ version_requirements: !ruby/object:Gem::Version::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.0.4
58
+ version: