Sha256: f53f4bc8d7351d7ac06fae4382f8a269136b02dc53eaeea81eef1adf7bd2805d

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

module HistoricalDating::Api
  def parser
    @parser ||= HistoricalDating::Parser.new
  end

  def parse(string, options = {})
    options = {
      locale: 'de'
    }.merge(options)

    unless options[:locale] == 'de'
      raise HistoricalDating::Error.new('locale_not_supported', locale: options[:locale])
    end

    result = parser.transform(string)
    HistoricalDating::Range.new(result[:from], result[:to])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
historical_dating-1.9.0 lib/historical_dating/api.rb
historical_dating-1.8.0 lib/historical_dating/api.rb
historical_dating-1.7.0 lib/historical_dating/api.rb
historical_dating-1.6.0 lib/historical_dating/api.rb
historical_dating-1.5.0 lib/historical_dating/api.rb