class Cronic::SpanDefinitions

Overview

SpanDefinitions subclasses return an Array of NamedTuples containing a match sequence and a Proc that calls a token handler (see handler.cr)

Included Modules

Direct Known Subclasses

Defined in:

cronic/definition.cr

Constructors

Instance Method Summary

Instance methods inherited from module Cronic::Handlers

day_or_time(day_start : Time, time_tokens, context : PointerDir = PointerDir::Future, **options) : Timespan | Nil day_or_time, find_within(tags, span : Nil, pointer : PointerDir)
find_within(tags, span : Timespan, pointer : PointerDir) : Timespan | Nil
find_within
, get_anchor(tokens, context = PointerDir::None, **options) get_anchor, get_repeaters(tokens) get_repeaters, handle_generic(tokens, text = "", **options) handle_generic, handle_o_r_g_r(tokens, **options) handle_o_r_g_r, handle_o_r_s_r(tokens, **options) handle_o_r_s_r, handle_od_rm(tokens, **options) handle_od_rm, handle_od_rmn(tokens, **options) : Timespan | Nil handle_od_rmn, handle_od_rmn_sy(tokens, **options) handle_od_rmn_sy, handle_ordday(tokens, text = "", **options) handle_ordday, handle_p_s_r(tokens, **options) handle_p_s_r, handle_r(tokens, **options) handle_r, handle_r_g_r(tokens, **options) handle_r_g_r, handle_rdn_od(tokens, context = PointerDir::Future, **options) handle_rdn_od, handle_rdn_rmn_od(tokens, **options) handle_rdn_rmn_od, handle_rdn_rmn_od_sy(tokens, **options) handle_rdn_rmn_od_sy, handle_rdn_rmn_sd(tokens, **options) handle_rdn_rmn_sd, handle_rdn_rmn_sd_sy(tokens, **options) handle_rdn_rmn_sd_sy, handle_rdn_rmn_sd_t_tz_sy(tokens, text = "", **opts) handle_rdn_rmn_sd_t_tz_sy, handle_rfc3339(tokens, text = "", **options) handle_rfc3339, handle_rfc3339_no_tz(tokens, text = "", **options) handle_rfc3339_no_tz, handle_rmn_od(tokens, **options) handle_rmn_od, handle_rmn_od_on(tokens, **options) handle_rmn_od_on, handle_rmn_od_sy(tokens, **options) handle_rmn_od_sy, handle_rmn_s_r_p(tokens, **options) handle_rmn_s_r_p, handle_rmn_sd(tokens, **options) handle_rmn_sd, handle_rmn_sd_on(tokens, **options) handle_rmn_sd_on, handle_rmn_sd_sy(tokens, **options) handle_rmn_sd_sy, handle_rmn_sy(tokens, **options) handle_rmn_sy, handle_rqn_sy(tokens, **options) handle_rqn_sy, handle_s_r_a_s_r_p_a(tokens, **options) handle_s_r_a_s_r_p_a, handle_s_r_p(tokens, **options) handle_s_r_p, handle_s_r_p_a(tokens, **options) handle_s_r_p_a, handle_sd_rmn(tokens, **options) handle_sd_rmn, handle_sd_rmn_sy(tokens, **options) handle_sd_rmn_sy, handle_sd_sm(tokens, **options) handle_sd_sm, handle_sd_sm_sy(tokens, **options) handle_sd_sm_sy, handle_sm_rmn_sy(tokens, **options) handle_sm_rmn_sy, handle_sm_sd(tokens, context = PointerDir::Future, **options) handle_sm_sd, handle_sm_sd_sy(tokens, **options) handle_sm_sd_sy, handle_sm_sy(tokens, **options) handle_sm_sy, handle_sy_rmn_od(tokens, **options) handle_sy_rmn_od, handle_sy_rqn(tokens, **options) handle_sy_rqn, handle_sy_sm(tokens, **options) handle_sy_sm, handle_sy_sm_sd(tokens, **options) handle_sy_sm_sd, handle_year_and_month(year : Int32, month : Int32) handle_year_and_month, subhandle_m_d(month, day, time_tokens, context = PointerDir::None, **options) subhandle_m_d, subhandle_orr(tokens, outer_span, **options) subhandle_orr, subhandle_srp(tokens, span : Timespan, **options) : Timespan | Nil subhandle_srp, xxhandle_rfc3339_no_tz(tokens, text = "", **options) xxhandle_rfc3339_no_tz

Class methods inherited from module Cronic::Handlers

dealias_and_disambiguate_times(tokens, ambiguous_time_range : Int32 | Nil = 6, **options) dealias_and_disambiguate_times

Constructor Detail

def self.new(now : Time) #

[View source]

Instance Method Detail

def anchor1 #

Shortcut for shared anchor #1


[View source]
def anchor2 #

Shortcut for shared anchor #2


[View source]
def anchor3 #

Shortcut for shared anchor #3


[View source]
def maybe(item) #

Shortcut for single-term Or with maybe


[View source]
def maybetime #

Shortcut for a time and day-portion

TODO Actually should be: ormaybe(RepeaterTime, seq(RepeaterTime, RepeaterDayPortion)), but this is not supported by our matching engine.


[View source]
def now : Time #

[View source]
def now=(now : Time) #

[View source]
def or(item, item2) #

Shortcut for double-term Or


[View source]
def ormaybe(item, item2) #

Shortcut for double-term Or with maybe


[View source]
def slashdash #

Shortcut for common date separators


[View source]