Class: Inspectable::Sanitizers::Struct
- Inherits:
-
Object
- Object
- Inspectable::Sanitizers::Struct
- Defined in:
- lib/inspectable/sanitizers/struct.rb
Overview
Excludes and transforms struct members.
Instance Method Summary collapse
- #call(instance, *excludes, **transformers) ⇒ Object
-
#initialize(pattern: "#<struct%<class>s %<body>s>", inspector: Inspectable::INSPECTOR) ⇒ Struct
constructor
A new instance of Struct.
Constructor Details
#initialize(pattern: "#<struct%<class>s %<body>s>", inspector: Inspectable::INSPECTOR) ⇒ Struct
Returns a new instance of Struct.
7 8 9 10 11 |
# File 'lib/inspectable/sanitizers/struct.rb', line 7 def initialize pattern: "#<struct%<class>s %<body>s>", inspector: Inspectable::INSPECTOR @pattern = pattern @inspector = inspector freeze end |
Instance Method Details
#call(instance, *excludes, **transformers) ⇒ Object
13 14 15 16 17 |
# File 'lib/inspectable/sanitizers/struct.rb', line 13 def call instance, *excludes, **transformers format pattern, class: instance.class.name.then { " #{it}" if it }, body: exclude_and_transform(instance, excludes, transformers).chomp(", ") end |