Class: Nickel::ConstructInterpreter
- Inherits:
-
Object
- Object
- Nickel::ConstructInterpreter
- Defined in:
- lib/nickel/construct_interpreter.rb
Instance Attribute Summary collapse
-
#constructs ⇒ Object
readonly
Returns the value of attribute constructs.
-
#curdate ⇒ Object
readonly
Returns the value of attribute curdate.
-
#occurrences ⇒ Object
readonly
Returns the value of attribute occurrences.
Instance Method Summary collapse
-
#initialize(constructs, curdate) ⇒ ConstructInterpreter
constructor
A new instance of ConstructInterpreter.
- #run ⇒ Object
Constructor Details
#initialize(constructs, curdate) ⇒ ConstructInterpreter
Returns a new instance of ConstructInterpreter.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/nickel/construct_interpreter.rb', line 8 def initialize(constructs, curdate) @constructs = constructs @curdate = curdate @occurrences = [] # output initialize_index_to_type_map initialize_user_input_style initialize_arrays_of_construct_indices initialize_sorted_time_map finalize_constructs end |
Instance Attribute Details
#constructs ⇒ Object (readonly)
Returns the value of attribute constructs.
6 7 8 |
# File 'lib/nickel/construct_interpreter.rb', line 6 def constructs @constructs end |
#curdate ⇒ Object (readonly)
Returns the value of attribute curdate.
6 7 8 |
# File 'lib/nickel/construct_interpreter.rb', line 6 def curdate @curdate end |
#occurrences ⇒ Object (readonly)
Returns the value of attribute occurrences.
6 7 8 |
# File 'lib/nickel/construct_interpreter.rb', line 6 def occurrences @occurrences end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nickel/construct_interpreter.rb', line 19 def run if found_dates occurrences_from_dates elsif found_one_date_span occurrences_from_one_date_span elsif found_recurrences_and_optional_date_span occurrences_from_recurrences_and_optional_date_span elsif found_wrappers_only occurrences_from_wrappers_only end end |