Sha256: 422f6fd0049978c290dae4aca943c1f1bf8fa852d938afbddd159fd5e4388e05

Contents?: true

Size: 446 Bytes

Versions: 2

Compression:

Stored size: 446 Bytes

Contents

module MetraSchedule
  class Stop
    attr_reader :station, :time

    def initialize(options={})
      unless options.has_key?(:station) and options.has_key?(:time)
        raise ArgumentError.new "Stop objects must have a station and a time"
      end
      @station = options[:station] if options.has_key?(:station)
      @time = options[:time] if options.has_key?(:time)
    end

    def is_after?(time)
      @time > time
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metra_schedule-0.2 lib/metra/stop.rb
metra_schedule-0.1 lib/metra/stop.rb