grid-number 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +4 -0
- data/lib/grid.rb +12 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81a1948d9b07246f629d878712114936467535c0
|
4
|
+
data.tar.gz: f1ddef604117a67aade85a42c93e0917cea955fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a72aee3c96e9fe0024523cea84a3a4681a7a7df6c204015f9c76f5fd75040fe5ecbb7aaadd51fda3da9f2b9c3d1c0a05a94c6e1d87d4676c9b61590d1c42c781
|
7
|
+
data.tar.gz: 2893d5ecac39590167775b819015156c5a5de6e9995d82d8203861782cb471bb1f0378eeb9d744f2afda150128981aea5332e76db99947a6381e31e7b08b667e
|
data/Changes
ADDED
data/lib/grid.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class GRid
|
2
|
-
VERSION = "0.0.
|
2
|
+
VERSION = "0.0.2".freeze
|
3
3
|
|
4
4
|
DEFAULT_ID_SCHEME = "A1".freeze
|
5
5
|
CHECK_CODES = (("0".."9").to_a + ("A".."Z").to_a).freeze
|
@@ -53,7 +53,7 @@ class GRid
|
|
53
53
|
|
54
54
|
# 2.5 has delete_prefix
|
55
55
|
str[i, j] = ""
|
56
|
-
str.sub!(/\A
|
56
|
+
str.sub!(/\A[-\s+]/, "")
|
57
57
|
|
58
58
|
val
|
59
59
|
end
|
@@ -99,7 +99,7 @@ class GRid
|
|
99
99
|
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
100
100
|
def #{name}=(s)
|
101
101
|
@#{name} = s
|
102
|
-
|
102
|
+
recalculate_check_character!
|
103
103
|
@#{name}
|
104
104
|
end
|
105
105
|
METHOD
|
@@ -125,6 +125,15 @@ class GRid
|
|
125
125
|
errors.empty?
|
126
126
|
end
|
127
127
|
|
128
|
+
#
|
129
|
+
# Recalculate the GRid's check character.
|
130
|
+
# This is only necessary when an invalid check character is provided to the instance.
|
131
|
+
#
|
132
|
+
def recalculate_check_character!
|
133
|
+
@check_character = calculate_check_character
|
134
|
+
nil
|
135
|
+
end
|
136
|
+
|
128
137
|
#
|
129
138
|
# Create a Hash representing the GRid. Keys are Symbols representing the portions of the GRid.
|
130
139
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grid-number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skye Shaw
|
@@ -63,6 +63,7 @@ extra_rdoc_files: []
|
|
63
63
|
files:
|
64
64
|
- ".gitignore"
|
65
65
|
- ".travis.yml"
|
66
|
+
- Changes
|
66
67
|
- Gemfile
|
67
68
|
- LICENSE.txt
|
68
69
|
- README.md
|