File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
## [ Unreleased]
2
2
3
+ - Add a note about Helper Inclusion to README
3
4
- Add ObjectInspector::InspectorsHelper#inspect! as a short form for #inspect(scope: : all )
4
5
5
6
### 0.9.0 - 2025-3-23
Original file line number Diff line number Diff line change @@ -181,6 +181,30 @@ MyObject.new.inspect
181
181
# => "<My Object(FLAG1) !!ISSUE1 | ISSUE2!! INFO :: NAME>"
182
182
```
183
183
184
+ ### Helper Inclusion
185
+
186
+ It may be useful to conditionally include ObjectInspector::InspectorsHelper, as well as other similar methods, via a mix-in.
187
+
188
+ ``` ruby
189
+ module ObjectInspectionBehaviors
190
+ extend ActiveSupport ::Concern
191
+
192
+ included do
193
+ # If you'd like to preserve the original inspect method, here is your
194
+ # chance to.
195
+ alias_method :__inspect__ , :inspect
196
+
197
+ include ObjectInspector ::InspectorsHelper
198
+ end
199
+
200
+ # An example of another, similar style of method you may wish to utilize in
201
+ # this mix-in.
202
+ def introspect
203
+ self
204
+ end
205
+ end
206
+ ```
207
+
184
208
## Scopes
185
209
186
210
Use the ` scope ` option to define the scope of the ` inspect_* ` methods. The supplied value will be wrapped by the ObjectInspector::Scope helper object.
You can’t perform that action at this time.
0 commit comments