diff options
Diffstat (limited to 'app/controllers/api')
| -rw-r--r-- | app/controllers/api/v1/companies_controller.rb | 13 | ||||
| -rw-r--r-- | app/controllers/api/v1/connection_links_controller.rb | 13 | ||||
| -rw-r--r-- | app/controllers/api/v1/time_tables_controller.rb | 13 | ||||
| -rw-r--r-- | app/controllers/api/v1/vehicle_journeys_controller.rb | 17 |
4 files changed, 56 insertions, 0 deletions
diff --git a/app/controllers/api/v1/companies_controller.rb b/app/controllers/api/v1/companies_controller.rb new file mode 100644 index 000000000..3f2cd2e7b --- /dev/null +++ b/app/controllers/api/v1/companies_controller.rb @@ -0,0 +1,13 @@ +class Api::V1::CompaniesController < Api::V1::ChouetteController + inherit_resources + + defaults :resource_class => Chouette::Company, :finder => :find_by_objectid! + +protected + + def collection + @companies ||= referential.companies + end + +end + diff --git a/app/controllers/api/v1/connection_links_controller.rb b/app/controllers/api/v1/connection_links_controller.rb new file mode 100644 index 000000000..7aa072cf3 --- /dev/null +++ b/app/controllers/api/v1/connection_links_controller.rb @@ -0,0 +1,13 @@ +class Api::V1::ConnectionLinksController < Api::V1::ChouetteController + inherit_resources + + defaults :resource_class => Chouette::ConnectionLink, :finder => :find_by_objectid! + +protected + + def collection + @connection_links ||= referential.connection_links + end + +end + diff --git a/app/controllers/api/v1/time_tables_controller.rb b/app/controllers/api/v1/time_tables_controller.rb new file mode 100644 index 000000000..53f564a52 --- /dev/null +++ b/app/controllers/api/v1/time_tables_controller.rb @@ -0,0 +1,13 @@ +class Api::V1::TimeTablesController < Api::V1::ChouetteController + inherit_resources + + defaults :resource_class => Chouette::TimeTable, :finder => :find_by_objectid! + +protected + + def collection + @time_tables ||= referential.time_tables + end + +end + diff --git a/app/controllers/api/v1/vehicle_journeys_controller.rb b/app/controllers/api/v1/vehicle_journeys_controller.rb new file mode 100644 index 000000000..2dd78cc19 --- /dev/null +++ b/app/controllers/api/v1/vehicle_journeys_controller.rb @@ -0,0 +1,17 @@ +class Api::V1::VehicleJourneysController < Api::V1::ChouetteController + inherit_resources + + defaults :resource_class => Chouette::VehicleJourney, :finder => :find_by_objectid! + + belongs_to :line, :parent_class => Chouette::Line, :optional => true, :finder => :find_by_objectid!, :param => :line_id do + belongs_to :route, :parent_class => Chouette::Route, :optional => true, :finder => :find_by_objectid!, :param => :route_id + end + +protected + + def collection + @vehicle_journeys ||= parent.vehicle_journeys + end + +end + |
