Class: RailsAiContext::Introspectors::ComponentIntrospector
- Inherits:
-
Object
- Object
- RailsAiContext::Introspectors::ComponentIntrospector
- Defined in:
- lib/rails_ai_context/introspectors/component_introspector.rb
Overview
Discovers ViewComponent and Phlex components: class definitions, slots, props, previews, and sidecar assets.
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(app) ⇒ ComponentIntrospector
constructor
A new instance of ComponentIntrospector.
Constructor Details
#initialize(app) ⇒ ComponentIntrospector
Returns a new instance of ComponentIntrospector.
10 11 12 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 10 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 8 def app @app end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 14 def call components = extract_components { components: components, summary: build_summary(components) } rescue => e { error: e. } end |