sip2 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/sip2/patron_information.rb +17 -3
- data/lib/sip2/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9431410bae36fdf3c566e033fe3cc4d88c42c5
|
4
|
+
data.tar.gz: 17507b9ad14b594133cf190451bd0e3c45406c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d19ef0aacc48fd5221495a9f4ab4a720b3072cd0d376919947a93b49eed87ea1785579b52f46b40efe9f719194ba660343e3bc92bbf08697dce2ae8a02bf93c
|
7
|
+
data.tar.gz: 6a984ab08d59ab0bd00038bab0e306d0858a3f8edeaac99d8651cb714b32259a12d5a023d9c57bcb38735bf126396d6a6f6ab1ae9ddccfb9b31549c4c5b81708
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[](https://travis-ci.org/TutoringAustralasia/sip2-ruby)
|
2
|
-
[](https://codeclimate.com/github/TutoringAustralasia/sip2-ruby)
|
3
2
|
[](#)
|
4
3
|
|
5
4
|
# 3M™ Standard Interchange Protocol v2 (SIP2) client implementation in Ruby
|
@@ -10,15 +10,19 @@ module Sip2
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def patron_valid?
|
13
|
-
raw_response
|
13
|
+
parse_boolean raw_response, 'BL'
|
14
14
|
end
|
15
15
|
|
16
16
|
def authenticated?
|
17
|
-
raw_response
|
17
|
+
parse_boolean raw_response, 'CQ'
|
18
18
|
end
|
19
19
|
|
20
20
|
def email
|
21
|
-
raw_response
|
21
|
+
parse_text raw_response, 'BE'
|
22
|
+
end
|
23
|
+
|
24
|
+
def location
|
25
|
+
parse_text raw_response, 'AQ'
|
22
26
|
end
|
23
27
|
|
24
28
|
def inspect
|
@@ -31,5 +35,15 @@ module Sip2
|
|
31
35
|
authenticated?
|
32
36
|
)
|
33
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def parse_boolean(response, message_id)
|
42
|
+
response[/\|#{message_id}([YN])\|/, 1] == 'Y'
|
43
|
+
end
|
44
|
+
|
45
|
+
def parse_text(response, message_id)
|
46
|
+
response[/\|#{message_id}(.*?)\|/, 1]
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
data/lib/sip2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sip2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- abrom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,8 +123,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.6.13
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: 3M™ Standard Interchange Protocol v2 client implementation in Ruby
|
130
130
|
test_files: []
|
131
|
+
has_rdoc:
|