-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinie.rb
More file actions
23 lines (20 loc) · 693 Bytes
/
Copy pathLinie.rb
File metadata and controls
23 lines (20 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Linie
# "LINIEN_ID";"BEZEICHNUNG";"REIHENFOLGE";"ECHTZEIT";"VERKEHRSMITTEL";"STAND"
attr_accessor :id, :bezeichnung, :reihenfolge, :echtzeit, :verkehrsmittel, :haltestellen
def initialize(csv_row)
@id = csv_row.field("LINIEN_ID").to_i
@bezeichnung = csv_row.field("BEZEICHNUNG")
@reihenfolge = csv_row.field("REIHENFOLGE")
@echtzeit = csv_row.field("ECHTZEIT")
@verkehrsmittel = csv_row.field("VERKEHRSMITTEL")
@haltestellen = Hash.new
end
def to_json
{ 'id' => @id,
'bezeichnung' => @bezeichnung,
'reihenfolge' => @reihenfolge,
'verkehrsmittel' => @verkehrsmittel,
'haltestellen' => @haltestellen
}.to_json
end
end