Class: Map::Tube::Station
- Inherits:
-
Object
- Object
- Map::Tube::Station
- Defined in:
- lib/map/tube/station.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#line ⇒ Object
Returns the value of attribute line.
-
#links ⇒ Object
Returns the value of attribute links.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_link(link) ⇒ Object
-
#initialize(id, name, line) ⇒ Station
constructor
A new instance of Station.
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
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/map/tube/station.rb', line 6 def id @id end |
#line ⇒ Object
Returns the value of attribute line.
6 7 8 |
# File 'lib/map/tube/station.rb', line 6 def line @line end |
#links ⇒ Object
Returns the value of attribute links.
6 7 8 |
# File 'lib/map/tube/station.rb', line 6 def links @links end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/map/tube/station.rb', line 6 def name @name end |
Instance Method Details
#add_link(link) ⇒ Object
15 16 17 |
# File 'lib/map/tube/station.rb', line 15 def add_link(link) @links << link end |