lib/alohaha.rb in Alohaha-0.0.3 vs lib/alohaha.rb in Alohaha-0.0.5
- old
+ new
@@ -1,10 +1,11 @@
-require 'open-uri'
+require 'curb'
require 'iconv'
require 'virtus'
require "alohaha/settings"
+require "alohaha/flight_helper"
require "alohaha/flight"
require "alohaha/flight_parse"
class Alohaha
include FlightParse
@@ -17,13 +18,28 @@
def flights
@flights
end
def arrivals
- @flights.select {|flights| flights.kind == 'Arrivals' }
+ @flights.arrivals
end
def departure
- @flights.select {|flights| flights.kind == 'Departure' }
+ @flights.departure
end
-end
+ def yesterday
+ @flights.yesterday
+ end
+
+ def today
+ @flights.today
+ end
+
+ def tomorrow
+ @flights.tomorrow
+ end
+
+ def by_datetime(datetime = DateTime.now)
+ @flights.by_datetime(datetime)
+ end
+end