Class: Stop

Inherits:
Object
  • Object
show all
Defined in:
lib/common/stop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/common/stop.rb', line 4

def id
  @id
end

#last_updatedObject

Returns the value of attribute last_updated.



4
5
6
# File 'lib/common/stop.rb', line 4

def last_updated
  @last_updated
end

#locationObject

Returns the value of attribute location.



4
5
6
# File 'lib/common/stop.rb', line 4

def location
  @location
end

#routesObject

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(options={})
  {
      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(*options)
  as_json(*options).to_json(*options)
end