SolidCallback
+SolidCallback
- +SolidCallback adds powerful method interception capabilities to your Ruby classes with near-zero overhead. Clean, flexible, and unobtrusive.
-Features
+Features
-
🔄 Method Lifecycle Hooks:
before_call,after_call, andaround_call- intercept methods without modifying their code -
@@ -79,7 +79,7 @@
Features
📝 Conditional execution: Run callbacks only when specific conditions are met
Installation
+Installation
Add this line to your application’s Gemfile:
@@ -96,9 +96,9 @@Installation
gem install solid_callback
-Usage
+Usage
-Basic Example
+Basic Example
require 'solid_callback'
@@ -142,7 +142,7 @@ Basic Example
service.find_user(42)
-Advanced Usage
+Advanced Usage
Apply callbacks to specific methods:
@@ -190,7 +190,7 @@Advanced Usage
before_call :notify_admin, if: -> { Rails.env.production? }
-Skipping Callbacks
+Skipping Callbacks
Skip callbacks for specific methods:
@@ -212,7 +212,7 @@Skipping Callbacks
end -Callback Options
+Callback Options
Each callback method accepts the following options:
@@ -225,25 +225,25 @@Callback Options
onlyexceptifunlessHow It Works
+How It Works
Callbacker uses Ruby’s metaprogramming to wrap your methods with callback functionality:
-
@@ -256,7 +256,7 @@
How It Works
When the method is called, it executes the callbacks in the proper order
📚 Use Cases
+📚 Use Cases
-
Authentication & Authorization
-
@@ -277,19 +277,19 @@
📚 Use Cases
Data transformation
🤝 Contributing
+🤝 Contributing
Bug reports and pull requests are welcome on GitHub at github.com/gklsan/solid_callback/issues.
-📄 License
+📄 License
The gem is available as open source under the terms of the MIT License.