Class: Transport::Station

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(station) ⇒ Station

Returns a new instance of Station.



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

def initialize(station)
  @id = station['id']
  @name = station['name']
  @score = station['score']
  @coordinate = Coordinate.new station['coordinate']
  @distance = station['distance']
  @type = station['type']
end

Instance Attribute Details

#coordinateObject (readonly)

Returns the value of attribute coordinate.



9
10
11
# File 'lib/station.rb', line 9

def coordinate
  @coordinate
end

#distanceObject (readonly)

Returns the value of attribute distance.



9
10
11
# File 'lib/station.rb', line 9

def distance
  @distance
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/station.rb', line 9

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/station.rb', line 9

def name
  @name
end

#scoreObject (readonly)

Returns the value of attribute score.



9
10
11
# File 'lib/station.rb', line 9

def score
  @score
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/station.rb', line 9

def type
  @type
end