Class: RailsDevtools::Routes::Collection
- Inherits:
-
Object
- Object
- RailsDevtools::Routes::Collection
- Defined in:
- app/models/rails_devtools/routes/collection.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.all ⇒ Object
6 7 8 |
# File 'app/models/rails_devtools/routes/collection.rb', line 6 def self.all new.all end |
.find(id) ⇒ Object
10 11 12 |
# File 'app/models/rails_devtools/routes/collection.rb', line 10 def self.find(id) new.find(id) end |
Instance Method Details
#all ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/rails_devtools/routes/collection.rb', line 14 def all return @all if defined?(@all) @all = [] @current_id = 0 add_routes(app_routes, engine_name: "Application") process_engine_routes(rails_routes) @all end |
#find(id) ⇒ Object
26 27 28 |
# File 'app/models/rails_devtools/routes/collection.rb', line 26 def find(id) all.find { |route| route.id == id.to_i } end |