0.0
No commit activity in last 3 years
No release in over 3 years
Query a timetable using a Polyrex document
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.0, ~> 0.3
>= 1.1.2, ~> 1.1
 Project Readme

Introducing the px_timetable gem

require 'px_timetable'

s =<<EOF
<?polyrex schema="days[title]/day[title]/klass[times,room,title,tutor]" format_mask[1]="[!times] [!room] [!title] # [!tutor]"?>
title: Super College HNC Life Skills Timetable

Monday
  9:00-12:15 5-06 Building FANs # Billy
  13:15-15:15 2-01 Hairdressing # Tam

Tuesday
  9:00-11:15 2-01 Developing skills # Bob
  11:15-13:15 5-06 Fun analysis # Billy
  14:15-16:30 1-02 Planning for reality # Maureen

Wednesday
  9:00-13:15 2-09 Engineering social media # Tam
  13:15-14:15 3-04 Learning tricks # Jock

EOF

File.write '/tmp/timetable.txt', s

timetable = PxTimetable.new '/tmp/timetable.txt'
puts timetable
Monday
  9:00-12:15 5-06 Building FANs # Billy
  13:15-15:15 2-01 Hairdressing # Tam
Tuesday
  9:00-11:15 2-01 Developing skills # Bob
  11:15-13:15 5-06 Fun analysis # Billy
  14:15-16:30 1-02 Planning for reality # Maureen
Wednesday
  9:00-13:15 2-09 Engineering social media # Tam
  13:15-14:15 3-04 Learning tricks # Jock

puts timetable.today
9:00-12:15 5-06 Building FANs # Billy
13:15-15:15 2-01 Hairdressing # Tam

t = Time.parse('09:00 19th Sep 2015')
puts timetable.now(t)
9:00-12:15 5-06 Building FANs # Billy
puts timetable.next(t)
13:15-15:15 2-01 Hairdressing # Tam
puts timetable.tomorrow.records.first
9:00-11:15 2-01 Developing skills # Bob

Resources

px_timetable timetable polyrex