Class: RailsAiContext::Introspectors::ComponentIntrospector
- Inherits:
-
Object
- Object
- RailsAiContext::Introspectors::ComponentIntrospector
- Extended by:
- StaticTier
- Defined in:
- lib/rails_ai_context/introspectors/component_introspector.rb
Overview
Discovers ViewComponent and Phlex components: class definitions, slots, props, previews, and sidecar assets.
Constant Summary
Constants included from StaticTier
StaticTier::ALTERNATE_SOURCE, StaticTier::FILES_ONLY, StaticTier::KINDS, StaticTier::RUNTIME_ONLY
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.
Methods included from StaticTier
answers_statically?, static_tier, static_tier_declared?, unavailable_reason, validate_static_tier!
Constructor Details
#initialize(app) ⇒ ComponentIntrospector
Returns a new instance of ComponentIntrospector.
13 14 15 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 13 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
11 12 13 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 11 def app @app end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/rails_ai_context/introspectors/component_introspector.rb', line 17 def call components = extract_components { components: components, summary: build_summary(components) } rescue => e { error: e. } end |