Class: RailsDevtools::Routes::EngineInfo
- Inherits:
-
Object
- Object
- RailsDevtools::Routes::EngineInfo
- Defined in:
- app/models/rails_devtools/routes/engine_info.rb
Instance Method Summary collapse
- #engine ⇒ Object
- #engine? ⇒ Boolean
- #helper_prefix ⇒ Object
-
#initialize(engine_name) ⇒ EngineInfo
constructor
A new instance of EngineInfo.
- #name ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(engine_name) ⇒ EngineInfo
Returns a new instance of EngineInfo.
4 5 6 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 4 def initialize(engine_name) @engine_name = engine_name end |
Instance Method Details
#engine ⇒ Object
8 9 10 11 12 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 8 def engine return Rails.application if @engine_name == "Application" @engine_name.constantize end |
#engine? ⇒ Boolean
14 15 16 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 14 def engine? @engine_name != "Application" end |
#helper_prefix ⇒ Object
26 27 28 29 30 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 26 def helper_prefix return "" unless engine? path.split("/").last.underscore end |
#name ⇒ Object
18 19 20 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 18 def name @engine_name end |
#path ⇒ Object
22 23 24 |
# File 'app/models/rails_devtools/routes/engine_info.rb', line 22 def path @path ||= engine.routes.find_script_name({}) end |