Class: AWSCronParser::Describer::FieldDescribers::DayOfMonth

Inherits:
Base
  • Object
show all
Defined in:
lib/aws_cron_parser/describer/field_describers/day_of_month.rb

Overview

Describes day-of-month field

Constant Summary collapse

NTH_PATTERN =
/^(\d+)#(\d+)$/
LAST_PATTERN =
/^(\d+)?L$/
WEEKDAY_PATTERN =
/^(\d+)W$/

Constants inherited from Base

Base::LIST_PATTERN, Base::RANGE_PATTERN, Base::STEP_PATTERN

Instance Attribute Summary

Attributes inherited from Base

#is_aws, #value

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers

included

Constructor Details

This class inherits a constructor from AWSCronParser::Describer::FieldDescribers::Base

Instance Method Details

#describeObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/aws_cron_parser/describer/field_describers/day_of_month.rb', line 14

def describe
  return nil if wildcard?

  # AWS-specific patterns
  if is_aws
    return describe_nth if value.match?(NTH_PATTERN)
    return describe_last if value.match?(LAST_PATTERN)
    return describe_closest_weekday if value.match?(WEEKDAY_PATTERN)
  end

  super # Use base class patterns
end