Class: DateFormats::RsssfDateParser

Inherits:
DateParser show all
Defined in:
lib/date-formats/parser.rb

Constant Summary collapse

MONTH_NAMES =
DateFormats.parse_month( <<TXT )
Jan
Feb
March  Mar
April  Apr
May
June   Jun
July   Jul
Aug
Sept   Sep
Oct
Nov
Dec
TXT
MONTH_EN =

re helper e.g. Jan|Feb|March|Mar|…

DateFormats.build_names( MONTH_NAMES )
EN__MONTH_DD__DATE_RE =

e.g.

[Jun 7]  or [Aug 12] etc.  - not MUST include brackets e.g. []

check add \b at the beginning and end - why?? why not?? working??
/\[
                     (?<month_name>#{MONTH_EN})
 \s
                     (?<day>\d{1,2})
\]/x

Instance Method Summary collapse

Methods inherited from DateParser

#find!, #parse

Methods included from Logging

#logger

Constructor Details

#initializeRsssfDateParser

Returns a new instance of RsssfDateParser.



243
244
245
246
247
248
# File 'lib/date-formats/parser.rb', line 243

def initialize
  super( lang: 'en',
         formats: [[EN__MONTH_DD__DATE_RE, '[EN_MONTH_DD]']],
         month_names: MONTH_NAMES
       )
end