Class: Chronic::DateDefinitions

Inherits:
SpanDefinitions show all
Defined in:
lib/chronic/definition.rb

Instance Attribute Summary

Attributes inherited from Definitions

#options

Instance Method Summary collapse

Methods included from Handlers

day_or_time, dealias_and_disambiguate_times, find_within, get_anchor, get_repeaters, handle_generic, handle_m_d, handle_o_r_g_r, handle_o_r_s_r, handle_od_rm, handle_od_rmn, handle_od_rmn_sy, handle_orr, handle_p_s_r, handle_r, handle_r_g_r, handle_rdn_od, handle_rdn_rmn_od, handle_rdn_rmn_od_sy, handle_rdn_rmn_sd, handle_rdn_rmn_sd_sy, handle_rmn_od, handle_rmn_od_on, handle_rmn_od_sy, handle_rmn_sd, handle_rmn_sd_on, handle_rmn_sd_sy, handle_rmn_sy, handle_s_r_a_s_r_p_a, handle_s_r_p, handle_s_r_p_a, handle_sd_rmn, handle_sd_rmn_sy, handle_sd_sm, handle_sd_sm_sy, handle_sm_rmn_sy, handle_sm_sd, handle_sm_sd_sy, handle_sm_sy, handle_srp, handle_sy_rmn_od, handle_sy_sm, handle_sy_sm_sd, handle_year_and_month, month_overflow?, time_with_rollover

Methods inherited from Definitions

#initialize

Constructor Details

This class inherits a constructor from Chronic::Definitions

Instance Method Details

#definitionsObject


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/chronic/definition.rb', line 32

def definitions
  [
    Handler.new([:repeater_day_name, :repeater_month_name, :scalar_day, :repeater_time, [:separator_slash?, :separator_dash?], :time_zone, :scalar_year], :handle_generic),
    Handler.new([:repeater_day_name, :repeater_month_name, :scalar_day], :handle_rdn_rmn_sd),
    Handler.new([:repeater_day_name, :repeater_month_name, :scalar_day, :scalar_year], :handle_rdn_rmn_sd_sy),
    Handler.new([:repeater_day_name, :repeater_month_name, :ordinal_day], :handle_rdn_rmn_od),
    Handler.new([:repeater_day_name, :repeater_month_name, :ordinal_day, :scalar_year], :handle_rdn_rmn_od_sy),
    Handler.new([:repeater_day_name, :repeater_month_name, :scalar_day, :separator_at?, 'time?'], :handle_rdn_rmn_sd),
    Handler.new([:repeater_day_name, :repeater_month_name, :ordinal_day, :separator_at?, 'time?'], :handle_rdn_rmn_od),
    Handler.new([:repeater_day_name, :ordinal_day, :separator_at?, 'time?'], :handle_rdn_od),
    Handler.new([:scalar_year, [:separator_slash, :separator_dash], :scalar_month, [:separator_slash, :separator_dash], :scalar_day, :repeater_time, :time_zone], :handle_generic),
    Handler.new([:ordinal_day], :handle_generic),
    Handler.new([:repeater_month_name, :scalar_day, :scalar_year], :handle_rmn_sd_sy),
    Handler.new([:repeater_month_name, :ordinal_day, :scalar_year], :handle_rmn_od_sy),
    Handler.new([:repeater_month_name, :scalar_day, :scalar_year, :separator_at?, 'time?'], :handle_rmn_sd_sy),
    Handler.new([:repeater_month_name, :ordinal_day, :scalar_year, :separator_at?, 'time?'], :handle_rmn_od_sy),
    Handler.new([:repeater_month_name, [:separator_slash?, :separator_dash?], :scalar_day, :separator_at?, 'time?'], :handle_rmn_sd),
    Handler.new([:repeater_time, :repeater_day_portion?, :separator_on?, :repeater_month_name, :scalar_day], :handle_rmn_sd_on),
    Handler.new([:repeater_month_name, :ordinal_day, :separator_at?, 'time?'], :handle_rmn_od),
    Handler.new([:ordinal_day, :repeater_month_name, :scalar_year, :separator_at?, 'time?'], :handle_od_rmn_sy),
    Handler.new([:ordinal_day, :repeater_month_name, :separator_at?, 'time?'], :handle_od_rmn),
    Handler.new([:ordinal_day, :grabber?, :repeater_month, :separator_at?, 'time?'], :handle_od_rm),
    Handler.new([:scalar_year, :repeater_month_name, :ordinal_day], :handle_sy_rmn_od),
    Handler.new([:repeater_time, :repeater_day_portion?, :separator_on?, :repeater_month_name, :ordinal_day], :handle_rmn_od_on),
    Handler.new([:repeater_month_name, :scalar_year], :handle_rmn_sy),
    Handler.new([:scalar_day, :repeater_month_name, :scalar_year, :separator_at?, 'time?'], :handle_sd_rmn_sy),
    Handler.new([:scalar_day, [:separator_slash?, :separator_dash?], :repeater_month_name, :separator_at?, 'time?'], :handle_sd_rmn),
    Handler.new([:scalar_year, [:separator_slash, :separator_dash], :scalar_month, [:separator_slash, :separator_dash], :scalar_day, :separator_at?, 'time?'], :handle_sy_sm_sd),
    Handler.new([:scalar_year, [:separator_slash, :separator_dash], :scalar_month], :handle_sy_sm),
    Handler.new([:scalar_month, [:separator_slash, :separator_dash], :scalar_year], :handle_sm_sy),
    Handler.new([:scalar_day, [:separator_slash, :separator_dash], :repeater_month_name, [:separator_slash, :separator_dash], :scalar_year, :repeater_time?], :handle_sm_rmn_sy),
    Handler.new([:scalar_year, [:separator_slash, :separator_dash], :scalar_month, [:separator_slash, :separator_dash], :scalar?, :time_zone], :handle_generic),
  ]
end