Class: GTFS::Meta::Feed
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- GTFS::Meta::Feed
- Defined in:
- lib/gtfs/meta/models/feed.rb
Instance Method Summary collapse
Instance Method Details
#source_file_name ⇒ Object
22 23 24 |
# File 'lib/gtfs/meta/models/feed.rb', line 22 def source_file_name source_url.split("/").last end |
#source_host_name ⇒ Object
18 19 20 |
# File 'lib/gtfs/meta/models/feed.rb', line 18 def source_host_name URI(source_url).hostname.split(".").reverse[1] end |
#source_zipness_validator ⇒ Object
14 15 16 |
# File 'lib/gtfs/meta/models/feed.rb', line 14 def source_zipness_validator errors.add(:source_url, "is not a zip") unless (source_url && source_file_name.ends_with?(".zip")) end |