Class: ScheduleParser
- Inherits:
-
Object
- Object
- ScheduleParser
- Defined in:
- lib/schedule_parser.rb
Instance Attribute Summary collapse
-
#result_hash ⇒ Object
readonly
Returns the value of attribute result_hash.
-
#schedule_yaml ⇒ Object
readonly
Returns the value of attribute schedule_yaml.
Instance Method Summary collapse
- #download! ⇒ Object
- #group_schedule(group) ⇒ Object
-
#initialize(schedule_path) ⇒ ScheduleParser
constructor
A new instance of ScheduleParser.
- #parse ⇒ Object
Constructor Details
#initialize(schedule_path) ⇒ ScheduleParser
Returns a new instance of ScheduleParser.
4 5 6 7 |
# File 'lib/schedule_parser.rb', line 4 def initialize schedule_path @schedule_yaml = schedule_path @result_hash = Hash.new end |
Instance Attribute Details
#result_hash ⇒ Object (readonly)
Returns the value of attribute result_hash.
2 3 4 |
# File 'lib/schedule_parser.rb', line 2 def result_hash @result_hash end |
#schedule_yaml ⇒ Object (readonly)
Returns the value of attribute schedule_yaml.
2 3 4 |
# File 'lib/schedule_parser.rb', line 2 def schedule_yaml @schedule_yaml end |
Instance Method Details
#download! ⇒ Object
19 20 21 22 |
# File 'lib/schedule_parser.rb', line 19 def download! download store_to_file end |
#group_schedule(group) ⇒ Object
14 15 16 17 |
# File 'lib/schedule_parser.rb', line 14 def group_schedule(group) group = group.to_i result_hash[group] end |
#parse ⇒ Object
9 10 11 12 |
# File 'lib/schedule_parser.rb', line 9 def parse confirm_file parse_from_file(schedule_yaml) end |