Class: Map::Tube::Station

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, line) ⇒ Station

Returns a new instance of Station.



8
9
10
11
12
13
# File 'lib/map/tube/station.rb', line 8

def initialize(id, name, line)
  @id = id
  @name = name
  @line = line
  @links = Set.new()
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/map/tube/station.rb', line 6

def id
  @id
end

#lineObject

Returns the value of attribute line.



6
7
8
# File 'lib/map/tube/station.rb', line 6

def line
  @line
end

Returns the value of attribute links.



6
7
8
# File 'lib/map/tube/station.rb', line 6

def links
  @links
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/map/tube/station.rb', line 6

def name
  @name
end

Instance Method Details



15
16
17
# File 'lib/map/tube/station.rb', line 15

def add_link(link)
  @links << link
end