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