Class: Station
- Inherits:
-
Object
- Object
- Station
- Defined in:
- lib/common/station.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_updated ⇒ Object
Returns the value of attribute last_updated.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#location ⇒ Object
Returns the value of attribute location.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(system_event) ⇒ Station
constructor
A new instance of Station.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(system_event) ⇒ Station
Returns a new instance of Station.
6 7 8 9 10 11 |
# File 'lib/common/station.rb', line 6 def initialize(system_event) @id = system_event[] @location = '' @lines = system_event[] @last_updated = system_event[] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/common/station.rb', line 4 def id @id end |
#last_updated ⇒ Object
Returns the value of attribute last_updated.
4 5 6 |
# File 'lib/common/station.rb', line 4 def last_updated @last_updated end |
#lines ⇒ Object
Returns the value of attribute lines.
4 5 6 |
# File 'lib/common/station.rb', line 4 def lines @lines end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/common/station.rb', line 4 def location @location end |
Instance Method Details
#as_json(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/common/station.rb', line 13 def as_json(={}) { id: @id, location: @location, lines: @lines, last_updated: @last_updated } end |
#to_json(*options) ⇒ Object
22 23 24 |
# File 'lib/common/station.rb', line 22 def to_json(*) as_json(*).to_json(*) end |