datacite-mapping 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +23 -11
  3. data/.ruby-version +1 -1
  4. data/CHANGES.md +5 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE.md +1 -1
  7. data/README.md +2 -2
  8. data/Rakefile +5 -3
  9. data/datacite-mapping.gemspec +9 -7
  10. data/examples/reading.rb +1 -1
  11. data/examples/writing.rb +1 -0
  12. data/lib/datacite/mapping.rb +2 -0
  13. data/lib/datacite/mapping/alternate_identifier.rb +4 -2
  14. data/lib/datacite/mapping/contributor.rb +5 -3
  15. data/lib/datacite/mapping/creator.rb +6 -4
  16. data/lib/datacite/mapping/date.rb +5 -5
  17. data/lib/datacite/mapping/date_value.rb +4 -2
  18. data/lib/datacite/mapping/description.rb +5 -3
  19. data/lib/datacite/mapping/empty_filtering_nodes.rb +2 -0
  20. data/lib/datacite/mapping/funding_reference.rb +6 -4
  21. data/lib/datacite/mapping/geo_location.rb +2 -0
  22. data/lib/datacite/mapping/geo_location_box.rb +12 -10
  23. data/lib/datacite/mapping/geo_location_node.rb +9 -7
  24. data/lib/datacite/mapping/geo_location_point.rb +8 -6
  25. data/lib/datacite/mapping/geo_location_polygon.rb +3 -1
  26. data/lib/datacite/mapping/identifier.rb +9 -7
  27. data/lib/datacite/mapping/module_info.rb +5 -3
  28. data/lib/datacite/mapping/name_identifier.rb +4 -2
  29. data/lib/datacite/mapping/namespace_extensions.rb +2 -0
  30. data/lib/datacite/mapping/read_only_nodes.rb +5 -3
  31. data/lib/datacite/mapping/related_identifier.rb +5 -3
  32. data/lib/datacite/mapping/resource.rb +15 -13
  33. data/lib/datacite/mapping/resource_type.rb +3 -1
  34. data/lib/datacite/mapping/rights.rb +3 -1
  35. data/lib/datacite/mapping/subject.rb +5 -3
  36. data/lib/datacite/mapping/title.rb +5 -3
  37. data/spec/.rubocop.yml +3 -0
  38. data/spec/rspec_custom_matchers.rb +8 -8
  39. data/spec/spec_helper.rb +2 -0
  40. data/spec/unit/datacite/mapping/alternate_identifier_spec.rb +2 -0
  41. data/spec/unit/datacite/mapping/contributor_spec.rb +2 -0
  42. data/spec/unit/datacite/mapping/creator_spec.rb +2 -0
  43. data/spec/unit/datacite/mapping/date_spec.rb +2 -0
  44. data/spec/unit/datacite/mapping/date_value_spec.rb +2 -0
  45. data/spec/unit/datacite/mapping/description_spec.rb +2 -0
  46. data/spec/unit/datacite/mapping/funding_reference_spec.rb +3 -1
  47. data/spec/unit/datacite/mapping/geo_location_box_spec.rb +2 -0
  48. data/spec/unit/datacite/mapping/geo_location_point_spec.rb +2 -0
  49. data/spec/unit/datacite/mapping/geo_location_polygon_spec.rb +22 -20
  50. data/spec/unit/datacite/mapping/geo_location_spec.rb +24 -22
  51. data/spec/unit/datacite/mapping/identifier_spec.rb +8 -6
  52. data/spec/unit/datacite/mapping/name_identifier_spec.rb +2 -0
  53. data/spec/unit/datacite/mapping/related_identifier_spec.rb +2 -0
  54. data/spec/unit/datacite/mapping/resource_spec.rb +22 -18
  55. data/spec/unit/datacite/mapping/rights_spec.rb +3 -1
  56. data/spec/unit/datacite/mapping/subject_spec.rb +2 -0
  57. data/spec/unit/datacite/mapping/title_spec.rb +2 -0
  58. metadata +26 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44bc8fb40c07e1508f27ec6da5fefe71e8c28406
4
- data.tar.gz: 3ec5ac8144c71ea213111a9b711c61d801cf76d1
3
+ metadata.gz: c6c6c78e95b15168e1d50cca76a43313c568e96f
4
+ data.tar.gz: '08f1de9f06449584c9b4bab11139cd0e79882bf0'
5
5
  SHA512:
6
- metadata.gz: 94be7b6dffca5c5ce26796e9c9149fc0fb3baa8211fd4420f32bc9a8898b931c05df37fe48b2c9fa4a234cf05949500376434511cd54a6c69b70022ab8cc2588
7
- data.tar.gz: 0eb19b29c6e37d1c11c3ab9539e22faacbdc8427314a88837600400c22d8d3e7984379f20a0b3f2537da4f6c6e8639209eb8b2e5ce5e0efc8acc8fe734c6c138
6
+ metadata.gz: 4d2b532ba6cb94d49403bebcef4afb565c7baee59c6ae43725b74fdbd9f6a40dd08ac88e68c2e907db47bab444352dc7c7d52046a2944341ca3df386cf088def
7
+ data.tar.gz: c69fc51f41731b7fd77692cf70714e8072ebfc0d3f847a24ee345428a2c382a3f2f901c5483c1d0ac26f2b0108c8081f9f4814ee92fe935556f7c84a8019e211
data/.rubocop.yml CHANGED
@@ -1,8 +1,3 @@
1
- # Disable compact style check for example.rb
2
- Style/ClassAndModuleChildren:
3
- Exclude:
4
- - 'example.rb'
5
-
6
1
  # Disable line-length check; it's too easy for the cure to be worse than the disease
7
2
  Metrics/LineLength:
8
3
  Enabled: False
@@ -11,18 +6,35 @@ Metrics/LineLength:
11
6
  Style/Documentation:
12
7
  Enabled: false
13
8
 
14
- # Allow one line around class body (Style/EmptyLines will still disallow two or more)
15
- Style/EmptyLinesAroundClassBody:
9
+ # Allow one line around class body (Layout/EmptyLines will still disallow two or more)
10
+ Layout/EmptyLinesAroundClassBody:
16
11
  Enabled: false
17
12
 
18
- # Allow one line around module body (Style/EmptyLines will still disallow two or more)
19
- Style/EmptyLinesAroundModuleBody:
13
+ # Allow one line around module body (Layout/EmptyLines will still disallow two or more)
14
+ Layout/EmptyLinesAroundModuleBody:
20
15
  Enabled: false
21
16
 
22
- # Allow one line around block body (Style/EmptyLines will still disallow two or more)
23
- Style/EmptyLinesAroundBlockBody:
17
+ # Allow one line around block body (Layout/EmptyLines will still disallow two or more)
18
+ Layout/EmptyLinesAroundBlockBody:
24
19
  Enabled: false
25
20
 
26
21
  # Allow leading underscores for 'internal' accessors
27
22
  Lint/UnderscorePrefixedVariableName:
28
23
  Enabled: false
24
+
25
+ # Seriously?
26
+ Style/CommentedKeyword:
27
+ Enabled: false
28
+
29
+ # Use DateTime to preserve compatibility
30
+ Style/DateTime:
31
+ Enabled: false
32
+
33
+ # Disable some checks in sample code
34
+ Style/ClassAndModuleChildren:
35
+ Exclude:
36
+ - 'examples/*'
37
+
38
+ Style/MixinUsage:
39
+ Exclude:
40
+ - 'examples/*'
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.5
1
+ 2.4.1
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.0 (2 January 2018)
2
+
3
+ - Update to Ruby 2.4.1
4
+ - Update to RuboCop 0.52
5
+
1
6
  ## 0.2.5 (10 January 2017)
2
7
 
3
8
  - Update to Ruby 2.2.5
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 The Regents of the University of California
3
+ Copyright (c) 2018 The Regents of the University of California
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -46,8 +46,8 @@ abstract.value
46
46
  # => "XML example of all DataCite Metadata Schema v4.0 properties."
47
47
  ```
48
48
 
49
- Note that Datacite::Mapping uses the `TypesafeEnum` gem to represent controlled vocabularies such
50
- as [ResourceTypeGeneral](http://www.rubydoc.info/github/CDLUC3/datacite-mapping/master/Datacite/Mapping/ResourceTypeGeneral)
49
+ Note that Datacite::Mapping uses the [TypesafeEnum](https://github.com/dmolesUC3/typesafe_enum) gem to represent controlled
50
+ vocabularies such as [ResourceTypeGeneral](http://www.rubydoc.info/github/CDLUC3/datacite-mapping/master/Datacite/Mapping/ResourceTypeGeneral)
51
51
  and [DescriptionType](http://www.rubydoc.info/github/CDLUC3/datacite-mapping/master/Datacite/Mapping/DescriptionType).
52
52
 
53
53
  ### Writing
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # ------------------------------------------------------------
2
4
  # RSpec
3
5
 
@@ -8,7 +10,7 @@ namespace :spec do
8
10
 
9
11
  desc 'Run all unit tests'
10
12
  RSpec::Core::RakeTask.new(:unit) do |task|
11
- task.rspec_opts = %w(--color --format documentation --order default)
13
+ task.rspec_opts = %w[--color --format documentation --order default]
12
14
  task.pattern = 'unit/**/*_spec.rb'
13
15
  end
14
16
 
@@ -38,7 +40,7 @@ RuboCop::RakeTask.new
38
40
 
39
41
  desc 'List TODOs (from spec/todo.rb)'
40
42
  RSpec::Core::RakeTask.new(:todo) do |task|
41
- task.rspec_opts = %w(--color --format documentation --order default)
43
+ task.rspec_opts = %w[--color --format documentation --order default]
42
44
  task.pattern = 'todo.rb'
43
45
  end
44
46
 
@@ -46,4 +48,4 @@ end
46
48
  # Defaults
47
49
 
48
50
  desc 'Run unit tests, check test coverage, run acceptance tests, check code style'
49
- task default: [:coverage, :rubocop]
51
+ task default: %i[coverage rubocop]
@@ -1,11 +1,13 @@
1
- # coding: utf-8
1
+
2
+ # frozen_string_literal: true
3
+
2
4
  lib = File.expand_path('../lib', __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
6
 
5
7
  require 'uri'
6
8
  require 'datacite/mapping/module_info'
7
9
 
8
- Gem::Specification.new do |spec|
10
+ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
9
11
  spec.name = Datacite::Mapping::NAME
10
12
  spec.version = Datacite::Mapping::VERSION
11
13
  spec.authors = ['David Moles']
@@ -15,7 +17,7 @@ Gem::Specification.new do |spec|
15
17
  spec.license = 'MIT'
16
18
 
17
19
  origin = `git config --get remote.origin.url`.chomp
18
- origin_uri = origin.start_with?('http') ? URI(origin) : URI(origin.sub('git@github.com:', 'https://github.com/'))
20
+ origin_uri = origin.start_with?('http') ? URI(origin) : URI(origin.gsub(%r{git@([^:]+)(.com|.org)[^\/]+}, 'http://\1\2'))
19
21
  spec.homepage = URI::HTTP.build(host: origin_uri.host, path: origin_uri.path.chomp('.git')).to_s
20
22
 
21
23
  spec.files = `git ls-files -z`.split("\x0")
@@ -29,12 +31,12 @@ Gem::Specification.new do |spec|
29
31
 
30
32
  spec.add_development_dependency 'bundler', '~> 1.7'
31
33
  spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
34
+ spec.add_development_dependency 'github-markup', '~> 1.4'
32
35
  spec.add_development_dependency 'rake', '~> 10.4'
36
+ spec.add_development_dependency 'redcarpet', '~> 3.3'
33
37
  spec.add_development_dependency 'rspec', '~> 3.2'
38
+ spec.add_development_dependency 'rubocop', '~> 0.52'
34
39
  spec.add_development_dependency 'simplecov', '~> 0.9.2'
35
40
  spec.add_development_dependency 'simplecov-console', '~> 0.2.0'
36
- spec.add_development_dependency 'rubocop', '~> 0.32.1'
37
- spec.add_development_dependency 'redcarpet', '~> 3.3'
38
- spec.add_development_dependency 'github-markup', '~> 1.4'
39
- spec.add_development_dependency 'yard', '~> 0.8'
41
+ spec.add_development_dependency 'yard', '~> 0.9'
40
42
  end
data/examples/reading.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # coding: UTF-8
2
+ # frozen_string_literal: true
3
3
 
4
4
  require 'datacite/mapping'
5
5
  include Datacite::Mapping
data/examples/writing.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'datacite/mapping'
4
5
  include Datacite::Mapping
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
  require 'rexml/formatters/transitive' # unaccountably, xml/mapping doesn't do this
3
5
  require 'xml/mapping_extensions'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  module Datacite
@@ -19,14 +21,14 @@ module Datacite
19
21
  # Sets the type. Cannot be nil.
20
22
  # @param val [String] the identifier type
21
23
  def type=(val)
22
- fail ArgumentError, 'No identifier type provided' unless val
24
+ raise ArgumentError, 'No identifier type provided' unless val
23
25
  @type = val
24
26
  end
25
27
 
26
28
  # Sets the value. Cannot be nil.
27
29
  # @param val [String] the value
28
30
  def value=(val)
29
- fail ArgumentError, 'No identifier value provided' unless val
31
+ raise ArgumentError, 'No identifier value provided' unless val
30
32
  @value = val
31
33
  end
32
34
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
  require 'datacite/mapping/name_identifier'
3
5
 
@@ -92,13 +94,13 @@ module Datacite
92
94
  end
93
95
 
94
96
  def name=(value)
95
- new_value = value && value.strip
96
- fail ArgumentError, 'Name cannot be empty or nil' unless new_value && !new_value.empty?
97
+ new_value = value&.strip
98
+ raise ArgumentError, 'Name cannot be empty or nil' unless new_value && !new_value.empty?
97
99
  @name = new_value
98
100
  end
99
101
 
100
102
  def type=(value)
101
- fail ArgumentError, 'Type cannot be nil' unless value
103
+ raise ArgumentError, 'Type cannot be nil' unless value
102
104
  @type = value
103
105
  end
104
106
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping'
2
4
  require 'datacite/mapping/read_only_nodes'
3
5
  require 'datacite/mapping/name_identifier'
@@ -23,18 +25,18 @@ module Datacite
23
25
  end
24
26
 
25
27
  def name=(value)
26
- new_value = value && value.strip
27
- fail ArgumentError, 'Name cannot be empty or nil' unless new_value && !new_value.empty?
28
+ new_value = value&.strip
29
+ raise ArgumentError, 'Name cannot be empty or nil' unless new_value && !new_value.empty?
28
30
  @name = new_value
29
31
  end
30
32
 
31
33
  def given_name=(value)
32
- new_value = value && value.strip
34
+ new_value = value&.strip
33
35
  @given_name = new_value
34
36
  end
35
37
 
36
38
  def family_name=(value)
37
- new_value = value && value.strip
39
+ new_value = value&.strip
38
40
  @family_name = new_value
39
41
  end
40
42
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  require 'datacite/mapping/date_value'
@@ -67,7 +69,7 @@ module Datacite
67
69
  end
68
70
 
69
71
  def type=(val)
70
- fail ArgumentError, 'Date type cannot be nil' unless val
72
+ raise ArgumentError, 'Date type cannot be nil' unless val
71
73
  @type = val
72
74
  end
73
75
 
@@ -80,14 +82,14 @@ module Datacite
80
82
  @range_start, @range_end = parts.map(&:strip).map { |part| DateValue.new(part) unless part == '' }
81
83
  # puts "#{val} -> [#{range_start}, #{range_end}]"
82
84
  else
83
- fail ArgumentError, "Unable to parse date value #{val}"
85
+ raise ArgumentError, "Unable to parse date value #{val}"
84
86
  end
85
87
  @value = date_value ? date_value.to_s : "#{range_start}/#{range_end}"
86
88
  end
87
89
 
88
90
  def <=>(other)
89
91
  return nil unless other.class == self.class
90
- [:date_value, :range_start, :range_end, :type].each do |v|
92
+ %i[date_value range_start range_end type].each do |v|
91
93
  order = send(v) <=> other.send(v)
92
94
  return order if order.nonzero?
93
95
  end
@@ -102,8 +104,6 @@ module Datacite
102
104
  @value
103
105
  end
104
106
 
105
- private
106
-
107
107
  # @!attribute [rw] type
108
108
  # @return [DateType] the type of date. Cannot be nil.
109
109
  typesafe_enum_node :type, '@dateType', class: DateType
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  module Datacite
@@ -52,12 +54,12 @@ module Datacite
52
54
  @nsec = datetime.to_time.nsec
53
55
  @zone = datetime.zone
54
56
  end
55
- fail ArgumentError, "Unable to parse date value '#{val}'" unless @year
57
+ raise ArgumentError, "Unable to parse date value '#{val}'" unless @year
56
58
  end
57
59
 
58
60
  def <=>(other)
59
61
  return nil unless other.class == self.class
60
- [:year, :month, :day, :hour, :minute, :sec, :nsec].each do |v|
62
+ %i[year month day hour minute sec nsec].each do |v|
61
63
  order = send(v) <=> other.send(v)
62
64
  return order if order.nonzero?
63
65
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  module Datacite
@@ -88,12 +90,12 @@ module Datacite
88
90
  end
89
91
 
90
92
  def language=(value)
91
- @language = value && value.strip
93
+ @language = value&.strip
92
94
  end
93
95
 
94
96
  def value=(v)
95
- new_value = v && v.strip
96
- fail ArgumentError, 'Value cannot be empty or nil' unless new_value && !new_value.empty?
97
+ new_value = v&.strip
98
+ raise ArgumentError, 'Value cannot be empty or nil' unless new_value && !new_value.empty?
97
99
  @value = new_value
98
100
  end
99
101
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  module Datacite
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
 
3
5
  module Datacite
@@ -28,12 +30,12 @@ module Datacite
28
30
  end
29
31
 
30
32
  def value=(value)
31
- fail ArgumentError, 'Value cannot be empty or nil' unless value && !value.empty?
33
+ raise ArgumentError, 'Value cannot be empty or nil' unless value && !value.empty?
32
34
  @value = value
33
35
  end
34
36
 
35
37
  def type=(value)
36
- fail ArgumentError, 'Type cannot be nil' unless value
38
+ raise ArgumentError, 'Type cannot be nil' unless value
37
39
  @type = value
38
40
  end
39
41
 
@@ -59,7 +61,7 @@ module Datacite
59
61
  end
60
62
 
61
63
  def value=(value)
62
- fail ArgumentError, 'Value cannot be empty or nil' unless value && !value.empty?
64
+ raise ArgumentError, 'Value cannot be empty or nil' unless value && !value.empty?
63
65
  @value = value
64
66
  end
65
67
 
@@ -93,7 +95,7 @@ module Datacite
93
95
  end
94
96
 
95
97
  def to_s
96
- fields = [:name, :identifier, :award_number, :award_title].map { |f| "#{f}: #{send(f)}" }
98
+ fields = %i[name identifier award_number award_title].map { |f| "#{f}: #{send(f)}" }
97
99
  "FundingReference { #{fields.join(', ')} }"
98
100
  end
99
101
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping_extensions'
2
4
  require 'datacite/mapping/geo_location_point'
3
5
  require 'datacite/mapping/geo_location_box'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'xml/mapping'
2
4
  require 'datacite/mapping/geo_location_node'
3
5
 
@@ -53,31 +55,31 @@ module Datacite
53
55
  when 4
54
56
  init_from_array(args)
55
57
  else
56
- fail ArgumentError, "Can't construct GeoLocationBox from arguments: #{args}"
58
+ raise ArgumentError, "Can't construct GeoLocationBox from arguments: #{args}"
57
59
  end
58
60
  end
59
61
 
60
62
  def south_latitude=(value)
61
- fail ArgumentError, 'South latitude cannot be nil' unless value
62
- fail ArgumentError, "#{value} is not a valid south latitude" unless value >= -90 && value <= 90
63
+ raise ArgumentError, 'South latitude cannot be nil' unless value
64
+ raise ArgumentError, "#{value} is not a valid south latitude" unless value >= -90 && value <= 90
63
65
  @south_latitude = value
64
66
  end
65
67
 
66
68
  def west_longitude=(value)
67
- fail ArgumentError, 'West longitude cannot be nil' unless value
68
- fail ArgumentError, "#{value} is not a valid west longitude" unless value >= -180 && value <= 180
69
+ raise ArgumentError, 'West longitude cannot be nil' unless value
70
+ raise ArgumentError, "#{value} is not a valid west longitude" unless value >= -180 && value <= 180
69
71
  @west_longitude = value
70
72
  end
71
73
 
72
74
  def north_latitude=(value)
73
- fail ArgumentError, 'North latitude cannot be nil' unless value
74
- fail ArgumentError, "#{value} is not a valid north latitude" unless value >= -90 && value <= 90
75
+ raise ArgumentError, 'North latitude cannot be nil' unless value
76
+ raise ArgumentError, "#{value} is not a valid north latitude" unless value >= -90 && value <= 90
75
77
  @north_latitude = value
76
78
  end
77
79
 
78
80
  def east_longitude=(value)
79
- fail ArgumentError, 'East longitude cannot be nil' unless value
80
- fail ArgumentError, "#{value} is not a valid east longitude" unless value >= -180 && value <= 180
81
+ raise ArgumentError, 'East longitude cannot be nil' unless value
82
+ raise ArgumentError, "#{value} is not a valid east longitude" unless value >= -180 && value <= 180
81
83
  @east_longitude = value
82
84
  end
83
85
 
@@ -94,7 +96,7 @@ module Datacite
94
96
  # {GeoLocationBox}
95
97
  def <=>(other)
96
98
  return nil unless other.class == self.class
97
- [:south_latitude, :west_longitude, :north_latitude, :east_longitude].each do |c|
99
+ %i[south_latitude west_longitude north_latitude east_longitude].each do |c|
98
100
  order = send(c) <=> other.send(c)
99
101
  return order if order.nonzero?
100
102
  end