Class: RailsAiBridge::Introspectors::ViewIntrospector
- Inherits:
-
Object
- Object
- RailsAiBridge::Introspectors::ViewIntrospector
- Defined in:
- lib/rails_ai_bridge/introspectors/view_introspector.rb
Overview
Scans view layer: layouts, templates, partials, helpers, view components, and template engine detection.
Constant Summary collapse
- PROVENANCE =
Evidence origin of each listing. Files found on disk are observed live, helper methods are scanned with a regex, and template engines are inferred from file extensions.
{ layouts: :live, templates: :live, partials: :live, helpers: :regex, view_components: :live, template_engines: :heuristic }.freeze
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#call ⇒ Hash
Builds a read-only summary of layouts, templates, partials, helpers, components, and template engines discovered through configured Rails paths.
-
#initialize(app) ⇒ ViewIntrospector
constructor
Initializes the view introspector and path resolver.
Constructor Details
#initialize(app) ⇒ ViewIntrospector
Initializes the view introspector and path resolver.
95 96 97 98 |
# File 'lib/rails_ai_bridge/introspectors/view_introspector.rb', line 95 def initialize(app) @app = app @path_resolver = PathResolver.new(app) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
19 20 21 |
# File 'lib/rails_ai_bridge/introspectors/view_introspector.rb', line 19 def app @app end |
Instance Method Details
#call ⇒ Hash
Builds a read-only summary of layouts, templates, partials, helpers, components, and template engines discovered through configured Rails paths.
105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/rails_ai_bridge/introspectors/view_introspector.rb', line 105 def call { layouts: extract_layouts, templates: extract_templates, partials: extract_partials, helpers: extract_helpers, view_components: extract_view_components, template_engines: detect_template_engines, provenance: PROVENANCE } rescue StandardError => error { error: error. } end |