Class: Transport::Stop

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stop) ⇒ Stop

Returns a new instance of Stop.



9
10
11
12
13
14
15
16
17
18
# File 'lib/stop.rb', line 9

def initialize(stop)
  return unless stop
  
  @station = Location.new stop['station']
  @name = stop['name']
  @category = stop['category']
  @number = stop['number']
  @operator = stop['operator']
  @to = stop['to']
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



7
8
9
# File 'lib/stop.rb', line 7

def category
  @category
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/stop.rb', line 7

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



7
8
9
# File 'lib/stop.rb', line 7

def number
  @number
end

#operatorObject (readonly)

Returns the value of attribute operator.



7
8
9
# File 'lib/stop.rb', line 7

def operator
  @operator
end

#stationObject (readonly)

Returns the value of attribute station.



7
8
9
# File 'lib/stop.rb', line 7

def station
  @station
end

#toObject (readonly)

Returns the value of attribute to.



7
8
9
# File 'lib/stop.rb', line 7

def to
  @to
end