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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a095a4d3648c8cb1432f0f8a7ce7a3712ff5ee7
4
- data.tar.gz: 97b4b2ad1878ae728cf925cf678552dd5bb431d9
3
+ metadata.gz: 9b9431410bae36fdf3c566e033fe3cc4d88c42c5
4
+ data.tar.gz: 17507b9ad14b594133cf190451bd0e3c45406c22
5
5
  SHA512:
6
- metadata.gz: bb34450723d3ee21271b38635227f1b1088af31be67818b75faec04f170b41f3598e5b9764ac20eb6b19987029bb1b13f5a7149483aa45f4445823d442cd1299
7
- data.tar.gz: 0b0a7ba9692d84d7031d62d5e83697606c98a904c4190bf5d2c6d0cd7c1452bf322280bc4a7847439741623683dc31e647340c77061a69f6adcb20531bcd8c7e
6
+ metadata.gz: 7d19ef0aacc48fd5221495a9f4ab4a720b3072cd0d376919947a93b49eed87ea1785579b52f46b40efe9f719194ba660343e3bc92bbf08697dce2ae8a02bf93c
7
+ data.tar.gz: 6a984ab08d59ab0bd00038bab0e306d0858a3f8edeaac99d8651cb714b32259a12d5a023d9c57bcb38735bf126396d6a6f6ab1ae9ddccfb9b31549c4c5b81708
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
1
  [![Travis Build Status](http://img.shields.io/travis/TutoringAustralasia/sip2-ruby.svg?style=flat)](https://travis-ci.org/TutoringAustralasia/sip2-ruby)
2
- [![Code Climate Score](http://img.shields.io/codeclimate/github/TutoringAustralasia/sip2-ruby.svg?style=flat)](https://codeclimate.com/github/TutoringAustralasia/sip2-ruby)
3
2
  [![Gem Version](http://img.shields.io/gem/v/sip2.svg?style=flat)](#)
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[/\|BL([YN])\|/, 1] == 'Y'
13
+ parse_boolean raw_response, 'BL'
14
14
  end
15
15
 
16
16
  def authenticated?
17
- raw_response[/\|CQ([YN])\|/, 1] == 'Y'
17
+ parse_boolean raw_response, 'CQ'
18
18
  end
19
19
 
20
20
  def email
21
- raw_response[/\|BE(.*?)\|/, 1]
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
@@ -1,3 +1,3 @@
1
1
  module Sip2
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
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.3
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-05-11 00:00:00.000000000 Z
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.4.8
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: