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.2.0'.freeze

Class Method Summary collapse

Class Method Details

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



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

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

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



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

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