silva 0.0.5 → 0.0.6

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.
@@ -37,14 +37,14 @@ module Silva
37
37
  #
38
38
  def gridref
39
39
  unless @gridref
40
- e100k = (easting / 100000).floor
41
- n100k = (northing / 100000).floor
40
+ e100k = (@easting / 100000).floor
41
+ n100k = (@northing / 100000).floor
42
42
 
43
43
  index = n100k * OSGB_GRID_WIDTH + e100k
44
44
  prefix = OSGB_PREFIXES[index]
45
45
 
46
- e = ((easting % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
47
- n = ((northing % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
46
+ e = ((@easting % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
47
+ n = ((@northing % OSGB_GRID_SCALE) / (10**(5 - @digits / 2))).round
48
48
 
49
49
  @gridref = prefix + e.to_s.rjust(@digits / 2) + n.to_s.rjust(@digits / 2)
50
50
  end
data/lib/silva/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Silva
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/test/test_gridref.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class TestGridref < Test::Unit::TestCase
2
- def test_inspect_gridref
2
+ def test_gridref_to_s
3
3
  Silva::Test::DATA.each do |data|
4
4
  options = { :gridref => data[:gridref], :digits => 8 }
5
5
  l = Silva::Location.from(:gridref, options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silva
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: