Class: AWSCronParser::Describer::CronComposer
- Inherits:
-
Object
- Object
- AWSCronParser::Describer::CronComposer
- Includes:
- Helpers
- Defined in:
- lib/aws_cron_parser/describer/cron_composer.rb
Overview
Composes complete CRON descriptions from field descriptions
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#is_aws ⇒ Object
readonly
Returns the value of attribute is_aws.
Instance Method Summary collapse
- #compose ⇒ Object
-
#initialize(config) ⇒ CronComposer
constructor
A new instance of CronComposer.
Methods included from Helpers
Constructor Details
#initialize(config) ⇒ CronComposer
Returns a new instance of CronComposer.
11 12 13 14 |
# File 'lib/aws_cron_parser/describer/cron_composer.rb', line 11 def initialize(config) @config = config @is_aws = config[:type]&.start_with?('aws-cron') end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/aws_cron_parser/describer/cron_composer.rb', line 9 def config @config end |
#is_aws ⇒ Object (readonly)
Returns the value of attribute is_aws.
9 10 11 |
# File 'lib/aws_cron_parser/describer/cron_composer.rb', line 9 def is_aws @is_aws end |
Instance Method Details
#compose ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/aws_cron_parser/describer/cron_composer.rb', line 16 def compose # Handle simple patterns first return quick_patterns if quick_patterns # Build component descriptions time_desc = TimeComposer.new(config, is_aws: is_aws).compose day_desc = DayComposer.new(config, is_aws: is_aws).compose month_desc = MonthComposer.new(config, is_aws: is_aws).compose # Compose final description based on what's set compose_description(time_desc, day_desc, month_desc) end |