Class: CocinaDisplay::Geospatial::CoordinatesParser

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina_display/geospatial.rb

Overview

Base class for parsers that convert strings into Coordinates objects. Subclasses must define at least the PATTERN constant and self.parse method.

Direct Known Subclasses

BoundingBoxParser, PointParser

Constant Summary collapse

PATTERN =
nil

Class Method Summary collapse

Class Method Details

.supports?(input_str) ⇒ Boolean

If true, use this parser for the given input string.

Parameters:

  • input_str (String)

Returns:

  • (Boolean)


225
226
227
# File 'lib/cocina_display/geospatial.rb', line 225

def self.supports?(input_str)
  input_str.match?(self::PATTERN)
end