Class: Skanetrafiken::Point
- Inherits:
-
Object
- Object
- Skanetrafiken::Point
- Defined in:
- lib/skanetrafiken/point.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(another_point) ⇒ Object
-
#initialize(name, id, type) ⇒ Point
constructor
A new instance of Point.
- #render ⇒ Object
Constructor Details
#initialize(name, id, type) ⇒ Point
Returns a new instance of Point.
7 8 9 10 11 |
# File 'lib/skanetrafiken/point.rb', line 7 def initialize(name,id,type) @name=name @id=id @type=type end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/skanetrafiken/point.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/skanetrafiken/point.rb', line 6 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/skanetrafiken/point.rb', line 6 def type @type end |
Instance Method Details
#==(another_point) ⇒ Object
12 13 14 |
# File 'lib/skanetrafiken/point.rb', line 12 def ==(another_point) self.name == another_point.name && self.id == another_point.id && self.type == another_point.type end |
#render ⇒ Object
15 16 17 18 |
# File 'lib/skanetrafiken/point.rb', line 15 def render() idx = $point_indexes.index(@type) return "#{@name}|#{@id}|#{idx}" end |