Module: EDTF

Defined in:
lib/edtf.rb,
lib/edtf/set.rb,
lib/edtf/epoch.rb,
lib/edtf/parser.rb,
lib/edtf/season.rb,
lib/edtf/unknown.rb,
lib/edtf/version.rb,
lib/edtf/interval.rb,
lib/edtf/uncertainty.rb

Overview

EDTF-Ruby

This module extends the Ruby date/time classes to support the Extended Date/Time Format (EDTF). See the ‘EDTF::ExtendedDate` module for an overview of the features added to the Ruby `Date` class.

To parse EDTF strings use either ‘Date.edtf` of `EDTF.parse`.

Defined Under Namespace

Classes: Century, Decade, Epoch, Interval, Parser, Season, Set, Uncertainty, Unknown, Unspecified

Constant Summary collapse

VERSION =
'3.0.5'.freeze

Class Method Summary collapse

Class Method Details

.parse(input, options = {}) ⇒ Object



72
73
74
75
76
# File 'lib/edtf.rb', line 72

def parse(input, options = {})
  parse!(input, options)
rescue
  nil
end

.parse!(input, options = {}) ⇒ Object



78
79
80
# File 'lib/edtf.rb', line 78

def parse!(input, options = {})
  ::Date.edtf!(input, options)
end