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.
5 6 7 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 5 def initialize(original_hash) @hash = original_hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
3 4 5 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 3 def hash @hash end |
Instance Method Details
#to_schedule {|schedule| ... } ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ice_cube/parsers/hash_parser.rb', line 9 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 |