Class: RailsAiBridge::Introspectors::ActiveStorageIntrospector
- Inherits:
-
Object
- Object
- RailsAiBridge::Introspectors::ActiveStorageIntrospector
- Defined in:
- lib/rails_ai_bridge/introspectors/active_storage_introspector.rb
Overview
Discovers Active Storage usage: attachments, storage service config, direct upload detection.
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#path_resolver ⇒ Object
readonly
Returns the value of attribute path_resolver.
Instance Method Summary collapse
-
#call ⇒ Hash
Builds a read-only summary of Active Storage usage.
-
#initialize(app) ⇒ ActiveStorageIntrospector
constructor
A new instance of ActiveStorageIntrospector.
Constructor Details
#initialize(app) ⇒ ActiveStorageIntrospector
Returns a new instance of ActiveStorageIntrospector.
11 12 13 14 |
# File 'lib/rails_ai_bridge/introspectors/active_storage_introspector.rb', line 11 def initialize(app) @app = app @path_resolver = PathResolver.new(app) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/rails_ai_bridge/introspectors/active_storage_introspector.rb', line 8 def app @app end |
#path_resolver ⇒ Object (readonly)
Returns the value of attribute path_resolver.
8 9 10 |
# File 'lib/rails_ai_bridge/introspectors/active_storage_introspector.rb', line 8 def path_resolver @path_resolver end |
Instance Method Details
#call ⇒ Hash
Builds a read-only summary of Active Storage usage.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rails_ai_bridge/introspectors/active_storage_introspector.rb', line 19 def call { installed: defined?(ActiveStorage) ? true : false, attachments: , storage_services: extract_storage_services, direct_upload: detect_direct_upload } rescue StandardError => error { error: error. } end |