Class: AWSCronParser::Describer::TimeComposer
- Inherits:
-
Object
- Object
- AWSCronParser::Describer::TimeComposer
- Includes:
- Helpers
- Defined in:
- lib/aws_cron_parser/describer/time_composer.rb
Overview
Composes time descriptions (second, minute, hour)
Instance Attribute Summary collapse
-
#hour ⇒ Object
readonly
Returns the value of attribute hour.
-
#is_aws ⇒ Object
readonly
Returns the value of attribute is_aws.
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#second ⇒ Object
readonly
Returns the value of attribute second.
Instance Method Summary collapse
- #compose ⇒ Object
-
#initialize(config, is_aws: false) ⇒ TimeComposer
constructor
A new instance of TimeComposer.
Methods included from Helpers
Constructor Details
#initialize(config, is_aws: false) ⇒ TimeComposer
Returns a new instance of TimeComposer.
11 12 13 14 15 16 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 11 def initialize(config, is_aws: false) @second = config[:second] @minute = config[:minute] @hour = config[:hour] @is_aws = is_aws end |
Instance Attribute Details
#hour ⇒ Object (readonly)
Returns the value of attribute hour.
9 10 11 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 9 def hour @hour end |
#is_aws ⇒ Object (readonly)
Returns the value of attribute is_aws.
9 10 11 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 9 def is_aws @is_aws end |
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
9 10 11 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 9 def minute @minute end |
#second ⇒ Object (readonly)
Returns the value of attribute second.
9 10 11 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 9 def second @second end |
Instance Method Details
#compose ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/aws_cron_parser/describer/time_composer.rb', line 18 def compose return nil if all_wildcards? # Try specific patterns first return describe_specific_time if specific_time? return describe_step_pattern if step_pattern? return describe_specific_second if specific_second_pattern? # General composition describe_general end |