Class: IceCube::HashParser
- Inherits:
-
Object
- Object
- IceCube::HashParser
- Defined in:
- lib/ice_cube/parsers/hash_parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(original_hash) ⇒ HashParser
constructor
A new instance of HashParser.
- #to_schedule {|schedule| ... } ⇒ Object
Constructor Details
#initialize(original_hash) ⇒ HashParser
Returns a new instance of HashParser.
6 7 8 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 6 def initialize(original_hash) @hash = original_hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
4 5 6 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 4 def hash @hash end |
Instance Method Details
#to_schedule {|schedule| ... } ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 10 def to_schedule data = normalize_keys(hash) schedule = IceCube::Schedule.new parse_time(data[:start_time]) apply_duration schedule, data apply_end_time schedule, data apply_rrules schedule, data apply_exrules schedule, data apply_rtimes schedule, data apply_extimes schedule, data yield schedule if block_given? schedule end |