Closed thestrauss3 closed 3 years ago
UPDATE: The source code for gtfs-0.2.5 (most recent release, same applies to 0.2.4) clearly does not include email
module GTFS
class Agency
include GTFS::Model
has_required_attrs :name, :url, :timezone
has_optional_attrs :id, :lang, :phone, :fare_url
attr_accessor *attrs
...
end
end
end
FYI, we've added the agency email field (as well as other additions) in our own fork at https://github.com/transitland/gtfs
Ah! I'll take a closer look at your repo, thanks
Field should now be published in v0.3.0
.
agencies = source.agencies
[27] pry(main)> agencies[1].email NoMethodError: undefined method `email' for #
[28] pry(main)> agencies[1]
=> #<GTFS::Agency:0x007f918c8b9b40
@id="2",
@lang="EN",
@name="Massport",
@phone="1-800-23-LOGAN",
@timezone="America/New_York",
@url="http://www.massport.com">
[29] pry(main)> agencies[1].fare_url
=> nil
pry(main)> GTFS::Agency.attrs => [:name, :url, :timezone, :id, :lang, :phone, :fare_url]
As you can see the agency in question does not have a fare_url or an email, but calling #fare_url => nil, whereas #email => NoMethodError