Class: Respect::Rails::Info
- Inherits:
-
Object
- Object
- Respect::Rails::Info
- Defined in:
- lib/respect/rails/info.rb
Overview
The implementation is strongly inspired from ActionDispatch::Routing::RoutesInspector.
Instance Attribute Summary (collapse)
-
- (Object) app
readonly
Returns the value of attribute app.
-
- (Object) engines
readonly
Returns the value of attribute engines.
-
- (Object) toc
readonly
Returns the value of attribute toc.
Instance Method Summary (collapse)
-
- (Info) initialize
constructor
A new instance of Info.
- - (Object) routes
Constructor Details
- (Info) initialize
A new instance of Info
7 8 9 10 11 12 13 |
# File 'lib/respect/rails/info.rb', line 7 def initialize @engines = {} @app = ApplicationInfo.new @app.routes = collect_routes(::Rails.application.routes.routes) @engines[@app.name] = @app @toc = build_toc(self.routes) end |
Instance Attribute Details
- (Object) app (readonly)
Returns the value of attribute app
16 17 18 |
# File 'lib/respect/rails/info.rb', line 16 def app @app end |
- (Object) engines (readonly)
Returns the value of attribute engines
15 16 17 |
# File 'lib/respect/rails/info.rb', line 15 def engines @engines end |
- (Object) toc (readonly)
Returns the value of attribute toc
17 18 19 |
# File 'lib/respect/rails/info.rb', line 17 def toc @toc end |
Instance Method Details
- (Object) routes
19 20 21 |
# File 'lib/respect/rails/info.rb', line 19 def routes @app.routes end |