Class: Stop

Inherits:
Object
  • Object
show all
Defined in:
lib/pennride/stop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, link) ⇒ Stop

Returns a new instance of Stop.



4
5
6
7
# File 'lib/pennride/stop.rb', line 4

def initialize(name, link)
  @name, @link = name, link
  @id = @link.split("/")[-1]
end

Instance Attribute Details

#arrival_times(link = @link) ⇒ Object

Returns array of arrival times (Strings) for the Stop Note: untested as PennRide isn’t operating over winter break



11
12
13
# File 'lib/pennride/stop.rb', line 11

def arrival_times
  @arrival_times
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/pennride/stop.rb', line 2

def id
  @id
end

Returns the value of attribute link.



2
3
4
# File 'lib/pennride/stop.rb', line 2

def link
  @link
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/pennride/stop.rb', line 2

def name
  @name
end