README.md in object_inspector-0.6.0 vs README.md in object_inspector-0.6.1
- old
+ new
@@ -453,9 +453,31 @@
MyObject.new.inspect(info: "my_method1") # => "<MyObject my_method1>"
MyObject.new.inspect(info: :my_method2) # => "<MyObject Result2>"
MyObject.new.inspect # => "<MyObject my_method2>"
```
+## Clearing Output for Specified Inspect Method
+
+Pass `nil` to any inspect method type to not display it:
+
+```ruby
+class MyObject
+ include ObjectInspector::InspectorsHelper
+
+ def inspect_identification; "My Object" end
+ def inspect_info; "INFO" end
+ def inspect_flags; "FLAG1" end
+ def inspect_issues; "ISSUE1" end
+end
+
+MyObject.new.inspect
+# => "<My Object(FLAG1) !!ISSUE1!! INFO>"
+MyObject.new.inspect(info: nil, flags: nil, issues: nil)
+# => "<My Object>"
+MyObject.new.inspect(identification: nil, info: nil, flags: nil, issues: nil)
+# => "<MyObject>"
+```
+
## Custom Formatters
A custom inspect formatter can be defined by implementing the interface defined by [ObjectInspector::BaseFormatter](https://github.com/pdobb/object_inspector/blob/master/lib/object_inspector/formatters/base_formatter.rb). Then, either override the ObjectInspector::Configuration#formatter_class value (see [Configuration](#configuration)) or just pass your custom class name into ObjectInspector::Inspector.new.