Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Fetch Line#network_code
Browse files Browse the repository at this point in the history
  • Loading branch information
zog committed Jun 26, 2019
1 parent cddb6eb commit 5664012
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/codifligne/v2/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def lines(params = {})
submode = line.css('TransportSubmode')
params[:transport_submode] = submode.first.content.strip if submode.first

params[:network_code] = line.css('RepresentedByGroupRef').try(:attribute, 'ref').try(:to_s)

params[:operator_codes] = []
line.css('OperatorRef').each do |operator|
params[:operator_codes] << operator.attribute('ref').to_s.split(':').last
Expand Down
2 changes: 1 addition & 1 deletion lib/codifligne/v2/line.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Codifligne::V2
class Line < Codifligne::Line
attr_accessor :name, :short_name, :operator_codes, :stif_id, :status, :accessibility, :transport_submode, :xml, :operator_ref, :secondary_operator_ref, :seasonal, :private_code, :color, :text_color, :line_notices, :valid_from, :valid_until
attr_accessor :name, :short_name, :operator_codes, :stif_id, :status, :accessibility, :transport_submode, :xml, :operator_ref, :secondary_operator_ref, :seasonal, :private_code, :color, :text_color, :line_notices, :valid_from, :valid_until, :network_code
end
end
2 changes: 1 addition & 1 deletion lib/codifligne/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Codifligne
VERSION = "0.1.15"
VERSION = "0.1.16"
end

0 comments on commit 5664012

Please sign in to comment.