Sha256: 28c8382af94711ab4d8bd98d5472fea12764be876ba0ffa8ddf516ceacf7b170

Contents?: true

Size: 439 Bytes

Versions: 2

Compression:

Stored size: 439 Bytes

Contents

module Nextbus
  class Direction

    include InstantiateWithAttrs
    include AttrWithDefault

    attr_accessor :tag, :title, :name, :route, :reports => [], :stops => []

    def self.all(agency_id, route_id)
      Nextbus.client.directions(agency_id, route_id).map{|direction| new(direction) }
    end

    def self.find(agency_id, route_id, id)
      all(agency_id, route_id).detect{|direction| direction.tag == id }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nextbus-0.0.1 lib/nextbus/direction.rb
nextbus-0.0.0 lib/nextbus/direction.rb