object_inspector 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3f1b53680d632fb88f63e951032b3be151ac352501620742cc091aaaf15a244
4
- data.tar.gz: 4a059bdf8a0f6033d52bd05c1bb24ad83d33f7dde4d0b8ccd7ae010630566506
3
+ metadata.gz: 391dabb8dbbee7bad63ca6a701193227c2829affa135db1b58035153ced6d079
4
+ data.tar.gz: 9ce283422270b1dee3a517dfb39cb52438504867924061277732e16ac58347ca
5
5
  SHA512:
6
- metadata.gz: 31eb8c71b23c092697db6b8f35b787581a472c13f6aded499602731546b2121fd07952650319e836af6368cf745f29f156ac2a31722a09a6d83cadb4c238e2d4
7
- data.tar.gz: 6e605745d774bcca73bf93ccd6b818044bb10365832c2f3b2f182bb1884b4de145f0328d81d82ae78fdf65a4609053f51b242ba2790e6071ca083111f5becc7b
6
+ metadata.gz: 662abef818a3761fafcddbac8dfb7c1219afb3d4b49d9eff61fe9b843c5e45b9af9b3714ce75f62164157dbd9d01a6ff9ffa35a774fa88f1f029929bf8e27e0f
7
+ data.tar.gz: 8d8048b05386af2d81bea333827e9efadfba6b4de9bf62375e164ca46455773c962b798162e11671594048848c4904deb4ec0304cbcec2dba0ee1705aeec77b2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 Paul DobbinSchmaltz
3
+ Copyright (c) 2024 Paul DobbinSchmaltz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,16 +1,15 @@
1
- # ObjectInspector
1
+ # Object Inspector
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/object_inspector.svg)](https://badge.fury.io/rb/object_inspector)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/34e821263d9e0c33d536/test_coverage)](https://codeclimate.com/github/pdobb/object_inspector/test_coverage)
3
+ [![Gem Version](https://img.shields.io/github/v/release/pdobb/object_inspector)](https://img.shields.io/github/v/release/pdobb/object_inspector)
4
+ [![CI Actions](https://github.com/pdobb/object_inspector/actions/workflows/ci.yml/badge.svg)](https://github.com/pdobb/object_inspector/actions)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/34e821263d9e0c33d536/maintainability)](https://codeclimate.com/github/pdobb/object_inspector/maintainability)
6
6
 
7
- ObjectInspector takes Object#inspect to the next level. Specify any combination of identification attributes, flags, issues, info, and/or a name along with an optional, self-definable scope option to represent objects. Great for the console, logging, etc.
7
+ Object Inspector takes Object#inspect to the next level. Specify any combination of identification attributes, flags, issues, info, and/or a name along with an optional, self-definable scope option to represent objects. Great for the console, logging, etc.
8
8
 
9
9
  Why? Because object inspection code should be uniform, easy to build, and its output should be easy to read!
10
10
 
11
11
  If you'd like to just jump into an example: [Full Example](#full-example).
12
12
 
13
-
14
13
  ## Installation
15
14
 
16
15
  Add this line to your application's Gemfile:
@@ -27,24 +26,19 @@ Or install it yourself:
27
26
 
28
27
  $ gem install object_inspector
29
28
 
30
-
31
29
  ## Compatibility
32
30
 
33
31
  Tested MRI Ruby Versions:
34
- * 2.3
35
- * 2.4
36
- * 2.5
37
- * 2.6
38
- * 2.7
39
- * 3.1
40
- * 3.2
41
32
 
42
- ObjectInspector has no other dependencies.
33
+ - 3.1
34
+ - 3.2
35
+ - 3.3
43
36
 
37
+ Object Inspector has no other dependencies.
44
38
 
45
39
  ## Configuration
46
40
 
47
- Global/default values for ObjectInspector can be configured via the ObjectInspector::Configuration object.
41
+ Global/default values for Object Inspector can be configured via the ObjectInspector::Configuration object.
48
42
 
49
43
  _Note: In a Rails app, the following would go in e.g. `config/initializers/object_inspector.rb`_
50
44
 
@@ -64,7 +58,6 @@ ObjectInspector.configure do |config|
64
58
  end
65
59
  ```
66
60
 
67
-
68
61
  ## Usage
69
62
 
70
63
  Given, an object of any type, call ObjectInspector::Inspector.inspect.
@@ -81,7 +74,6 @@ MyObject.new.inspect # => "<MyObject>"
81
74
 
82
75
  See also [Helper Usage](#helper-usage) for an even simpler usage option.
83
76
 
84
-
85
77
  ### Output Customization
86
78
 
87
79
  Use the `identification`, `flags`, `info`, and/or `name` options to customize inspect output.
@@ -122,7 +114,6 @@ MyObject.new.inspect
122
114
  # => "<My Object(FLAG1 / FLAG2) !!ISSUE1 | ISSUE2!! INFO :: NAME>"
123
115
  ```
124
116
 
125
-
126
117
  ## Helper Usage
127
118
 
128
119
  To save some typing, include ObjectInspector::InspectHelper into an object and ObjectInspector::Inspector.inspect will be called on `self` automatically.
@@ -173,13 +164,11 @@ MyObject.new.inspect
173
164
  # => "<My Object(FLAG1) !!ISSUE1 | ISSUE2!! INFO :: NAME>"
174
165
  ```
175
166
 
176
-
177
167
  ## Scopes
178
168
 
179
169
  Use the `scope` option to define the scope of the `inspect_*` methods. The supplied value will be wrapped by the ObjectInspector::Scope helper object.
180
170
  The default value is `ObjectInspector::Scope.new(:self)`.
181
171
 
182
-
183
172
  ### Scope Names
184
173
 
185
174
  ObjectInspector::Scope acts like [ActiveSupport::StringInquirer](http://api.rubyonrails.org/classes/ActiveSupport/StringInquirer.html). This is a prettier way to test for a given type of "scope" within objects.
@@ -190,8 +179,8 @@ The ObjectInspector::Scope objects in these examples are the same as specifying
190
179
  my_object.inspect(scope: <scope_name>)
191
180
  ```
192
181
 
193
-
194
182
  Options:
183
+
195
184
  - `:self` (Default) -- Is meant to confine object interrogation to self (don't interrogate neighboring objects).
196
185
  - `:all` -- Is meant to match on all scopes, regardless of their name.
197
186
  - `<custom>` -- Anything else that makes sense for the object to key on.
@@ -203,7 +192,6 @@ scope.verbose? # => false
203
192
  scope.complex? # => false
204
193
  ```
205
194
 
206
-
207
195
  #### Multiple Scope Names
208
196
 
209
197
  It is also possible to pass in multiple scope names to match on.
@@ -215,7 +203,6 @@ scope.verbose? # => true
215
203
  scope.complex? # => true
216
204
  ```
217
205
 
218
-
219
206
  #### The "Wild Card" Scope
220
207
 
221
208
  Finally, `:all` is a "wild card" scope name, and will match on all scope names.
@@ -227,7 +214,6 @@ scope.verbose? # => true
227
214
  scope.complex? # => true
228
215
  ```
229
216
 
230
-
231
217
  ### Scope blocks
232
218
 
233
219
  Passing a block to a scope predicate falls back to the out-of-scope placeholder (`*` by default) if the scope does not match.
@@ -238,7 +224,6 @@ scope.verbose? { "MATCH" } # => "MATCH"
238
224
  scope.complex? { "MATCH" } # => "*"
239
225
  ```
240
226
 
241
-
242
227
  ### Scope Joiners
243
228
 
244
229
  ObjectInspector::Scope also offers helper methods for uniformly joining inspect elements:
@@ -256,7 +241,6 @@ scope.join_info([1, 2, 3]) # => "1 | 2 | 3"
256
241
  scope.join_info([1, 2, 3, nil]) # => "1 | 2 | 3"
257
242
  ```
258
243
 
259
-
260
244
  ## Full Example
261
245
 
262
246
  ```ruby
@@ -347,7 +331,6 @@ my_object.inspect
347
331
  # => "<MyObject[a2:2](DEFAULT_FLAG / AO1_FLAG1 / AO2_FLAG1) !!!!WARNING!!!! Default Info | Complex Info | Verbose Info :: Name>"
348
332
  ```
349
333
 
350
-
351
334
  ## Wrapped Objects
352
335
 
353
336
  If the Object being inspected wraps another object -- i.e. defines #to_model and #to_model returns an object other than self -- the inspect output will re-inspect the wrapped object. The wrapper points to the wrapped object with an arrow (⇨).
@@ -380,7 +363,6 @@ MyWrapperObject.new.inspect
380
363
 
381
364
  This feature is recursive.
382
365
 
383
-
384
366
  ### Wrapped Delegators
385
367
 
386
368
  If the Object being inspected is wrapped by an object that delegates all unknown methods to the wrapped object, then inspect flags will be doubled up. To get around this, redefine the `inspect` method in the Wrapper object e.g. like:
@@ -393,13 +375,13 @@ class MyDelegatingWrapperObject
393
375
  @my_object = my_object
394
376
  end
395
377
 
396
- def inspect(**kargs)
378
+ def inspect(**kwargs)
397
379
  super(identification: self.class.name,
398
380
  name: nil,
399
381
  flags: nil,
400
382
  info: nil,
401
383
  issues: nil,
402
- **kargs)
384
+ **kwargs)
403
385
  end
404
386
 
405
387
  def to_model
@@ -436,7 +418,6 @@ MyDelegatingWrapperObject.new(MyWrappedObject.new).inspect
436
418
  # => "<MyDelegatingWrapperObject> ⇨ <MyWrappedObject(FLAG1) !!ISSUE1!! INFO :: NAME>"
437
419
  ```
438
420
 
439
-
440
421
  ## On-the-fly Inspect Methods
441
422
 
442
423
  When passed as an option (as opposed to being called via an Object-defined method) symbols will be called/evaluated on Object on the fly.
@@ -478,7 +459,6 @@ MyObject.new.inspect(identification: nil, info: nil, flags: nil, issues: nil)
478
459
  # => "<MyObject>"
479
460
  ```
480
461
 
481
-
482
462
  ## Custom Formatters
483
463
 
484
464
  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.
@@ -507,13 +487,13 @@ MyObject.new.inspect
507
487
  ```
508
488
 
509
489
  See examples:
490
+
510
491
  - [ObjectInspector::TemplatingFormatter]
511
492
  - [ObjectInspector::CombiningFormatter]
512
493
 
513
-
514
494
  ## Supporting Gems
515
495
 
516
- ObjectInspector works great with the [ObjectIdentifier](https://github.com/pdobb/object_identifier) gem.
496
+ Object Inspector works great with the [Object Identifier](https://github.com/pdobb/object_identifier) gem.
517
497
 
518
498
  ```ruby
519
499
  class MyObject
@@ -543,31 +523,29 @@ MyObject.new.inspect
543
523
  # => "<MyObject[my_method1:1, my_method2:2](FLAG1 / FLAG2) !!ISSUE1 | ISSUE2!! INFO :: NAME>"
544
524
  ```
545
525
 
546
-
547
526
  ## Performance
548
527
 
549
- ### Benchmarking ObjectInspector
528
+ ### Benchmarking Object Inspector
550
529
 
551
530
  ObjectInspetor is ~4x slower than Ruby's default inspect.
552
531
 
553
- Performance of ObjectInspect can be tested by playing the [ObjectInspector Benchmarking Scripts] in the pry console for this gem.
532
+ Performance of Object Inspector can be tested by playing the [Object Inspector Benchmarking Script](https://github.com/pdobb/object_inspector/blob/master/script/benchmarking/object_inspector.rb) in the IRB console for this gem.
554
533
 
555
534
  ```ruby
556
- play scripts/benchmarking/object_inspector.rb
535
+ load "script/benchmarking/object_inspector.rb"
557
536
  # Comparison:
558
537
  # Ruby: 30382.2 i/s
559
538
  # ObjectInspector::Inspector: 7712.2 i/s - 3.94x slower
560
539
  ```
561
540
 
562
-
563
541
  ### Benchmarking Formatters
564
542
 
565
543
  [ObjectInspector::TemplatingFormatter] -- which is the default Formatter -- outperforms [ObjectInspector::CombiningFormatter] by about 30% on average.
566
544
 
567
- Performance of Formatters can be tested by playing the [Formatters Benchmarking Scripts] in the pry console for this gem.
545
+ Performance of Formatters can be tested by playing the [Formatters Benchmarking Scripts](https://github.com/pdobb/object_inspector/blob/master/script/benchmarking/formatters.rb) in the IRB console for this gem.
568
546
 
569
547
  ```ruby
570
- play scripts/benchmarking/formatters.rb
548
+ load "script/benchmarking/formatters.rb"
571
549
  # == Averaged =============================================================
572
550
  # ...
573
551
  #
@@ -578,7 +556,6 @@ play scripts/benchmarking/formatters.rb
578
556
  # == Done
579
557
  ```
580
558
 
581
-
582
559
  #### Benchmarking Custom Formatters
583
560
 
584
561
  Custom Formatters may be similarly gauged for comparison by adding them to the `custom_formatter_klasses` array before playing the script.
@@ -586,7 +563,7 @@ Custom Formatters may be similarly gauged for comparison by adding them to the `
586
563
  ```ruby
587
564
  custom_formatter_klasses = [MyCustomFormatter]
588
565
 
589
- play scripts/benchmarking/formatters.rb
566
+ play script/benchmarking/formatters.rb
590
567
  # == Averaged =============================================================
591
568
  # ...
592
569
  #
@@ -598,27 +575,60 @@ play scripts/benchmarking/formatters.rb
598
575
  # == Done
599
576
  ```
600
577
 
601
-
602
578
  ## Development
603
579
 
604
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
580
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. Or, run `rake` to run the tests plus linters as well as `yard` (to confirm proper YARD documentation practices). You can also run `bin/console` for an interactive prompt that will allow you to experiment.
605
581
 
606
582
  To install this gem onto your local machine, run `bundle exec rake install`.
607
583
 
608
- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
584
+ ### Testing
585
+
586
+ To test this gem (gemwork):
587
+
588
+ ```bash
589
+ rake
590
+ ```
591
+
592
+ #### Linters
593
+
594
+ ```bash
595
+ rubocop
596
+
597
+ reek
609
598
 
599
+ npx prettier . --check
600
+ npx prettier . --write
601
+ ```
602
+
603
+ ### Releases
604
+
605
+ To release a new version of object_inspector to RubyGems:
606
+
607
+ 1. Update the version number in `version.rb`
608
+ 2. Update `CHANGELOG.md`
609
+ 3. Run `bundle` to update Gemfile.lock with the latest version info
610
+ 4. Commit the changes. e.g. `Bump to vX.Y.Z`
611
+ 5. Run `rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
612
+
613
+ ### Documentation
614
+
615
+ [YARD documentation](https://yardoc.org/index.html) can be generated and viewed live:
616
+
617
+ 1. Install YARD: `gem install yard`
618
+ 2. Run the YARD server: `yard server --reload`
619
+ 3. Open the live documentation site: `open http://localhost:8808`
620
+
621
+ While the YARD server is running, documentation in the live site will be auto-updated on source code save (and site reload).
610
622
 
611
623
  ## Contributing
612
624
 
613
625
  Bug reports and pull requests are welcome on GitHub at https://github.com/pdobb/object_inspector.
614
626
 
615
-
616
627
  ## License
617
628
 
618
629
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
619
630
 
620
-
621
631
  [ObjectInspector::TemplatingFormatter]: https://github.com/pdobb/object_inspector/blob/master/lib/object_inspector/formatters/templating_formatter.rb
622
632
  [ObjectInspector::CombiningFormatter]: https://github.com/pdobb/object_inspector/blob/master/lib/object_inspector/formatters/combining_formatter.rb
623
- [ObjectInspector Benchmarking Scripts]: https://github.com/pdobb/object_inspector/blob/master/scripts/benchmarking/object_inspector.rb
624
- [Formatters Benchmarking Scripts]: https://github.com/pdobb/object_inspector/blob/master/scripts/benchmarking/formatters.rb
633
+ [Object Inspector Benchmarking Scripts]: https://github.com/pdobb/object_inspector/blob/master/script/benchmarking/object_inspector.rb
634
+ [Formatters Benchmarking Scripts]: https://github.com/pdobb/object_inspector/blob/master/script/benchmarking/formatters.rb
@@ -1,23 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ObjectInspector
4
- # ObjectInspector::Conversions defines conversion functions used by
5
- # ObjectInspector.
6
- module Conversions
7
- module_function
3
+ # ObjectInspector::Conversions defines conversion functions used by
4
+ # ObjectInspector.
5
+ module ObjectInspector::Conversions
6
+ module_function
8
7
 
9
- # Convert the passed in value to an {ObjectInspector::Scope} object.
10
- # Just returns the pass in value if it already is an
11
- # {ObjectInspector::Scope} object.
12
- #
13
- # @return [ObjectInspector::Scope]
14
- def Scope(value) # rubocop:disable Naming/MethodName
15
- case value
16
- when ObjectInspector::Scope
17
- value
18
- else
19
- ObjectInspector::Scope.new(value)
20
- end
8
+ # Convert the passed in value to an {ObjectInspector::Scope} object.
9
+ # Just returns the passed in value if it already is an
10
+ # {ObjectInspector::Scope} object.
11
+ #
12
+ # @return [ObjectInspector::Scope]
13
+ #
14
+ # :reek:UncommunicativeMethodName
15
+ def Scope(value) # rubocop:disable Naming/MethodName
16
+ case value
17
+ when ObjectInspector::Scope
18
+ value
19
+ else
20
+ ObjectInspector::Scope.new(value)
21
21
  end
22
22
  end
23
23
  end
@@ -1,71 +1,69 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ObjectInspector
4
- # ObjectInspector::BaseFormatter is an abstract base class that interfaces
5
- # with {ObjectInspector::Inspector} objects to combine the supplied
6
- # {#identification}, {#flags}, {#info}, and {#name} strings into a friendly
7
- # "inspect" String.
8
- class BaseFormatter
9
- attr_reader :inspector
3
+ # ObjectInspector::BaseFormatter is an abstract base class that interfaces
4
+ # with {ObjectInspector::Inspector} objects to combine the supplied
5
+ # {#identification}, {#flags}, {#info}, and {#name} strings into a friendly
6
+ # "inspect" String.
7
+ class ObjectInspector::BaseFormatter
8
+ attr_reader :inspector
10
9
 
11
- # @param inspector [ObjectInspector::Inspector]
12
- def initialize(inspector)
13
- @inspector = inspector
14
- end
10
+ # @param inspector [ObjectInspector::Inspector]
11
+ def initialize(inspector)
12
+ @inspector = inspector
13
+ end
15
14
 
16
- # Perform the formatting routine.
17
- #
18
- # @return [String]
19
- def call
20
- raise NotImplementedError
21
- end
15
+ # Perform the formatting routine.
16
+ #
17
+ # @return [String]
18
+ def call
19
+ raise NotImplementedError
20
+ end
22
21
 
23
- # Delegates to {Inspector#wrapped_object_inspection_result}.
24
- #
25
- # @return [String] if given
26
- # @return [NilClass] if not given
27
- def wrapped_object_inspection_result
28
- @wrapped_object_inspection_result ||=
29
- @inspector.wrapped_object_inspection_result
30
- end
22
+ # Delegates to {Inspector#wrapped_object_inspection_result}.
23
+ #
24
+ # @return [String] if given
25
+ # @return [NilClass] if not given
26
+ def wrapped_object_inspection_result
27
+ @wrapped_object_inspection_result ||=
28
+ @inspector.wrapped_object_inspection_result
29
+ end
31
30
 
32
- # Delegates to {Inspector#identification}.
33
- #
34
- # @return [String] if given
35
- def identification
36
- @identification ||= @inspector.identification
37
- end
31
+ # Delegates to {Inspector#identification}.
32
+ #
33
+ # @return [String] if given
34
+ def identification
35
+ @identification ||= @inspector.identification
36
+ end
38
37
 
39
- # Delegates to {Inspector#flags}.
40
- #
41
- # @return [String] if given
42
- # @return [NilClass] if not given
43
- def flags
44
- @flags ||= @inspector.flags
45
- end
38
+ # Delegates to {Inspector#flags}.
39
+ #
40
+ # @return [String] if given
41
+ # @return [NilClass] if not given
42
+ def flags
43
+ @flags ||= @inspector.flags
44
+ end
46
45
 
47
- # Delegates to {Inspector#issues}.
48
- #
49
- # @return [String] if given
50
- # @return [NilClass] if not given
51
- def issues
52
- @issues ||= @inspector.issues
53
- end
46
+ # Delegates to {Inspector#issues}.
47
+ #
48
+ # @return [String] if given
49
+ # @return [NilClass] if not given
50
+ def issues
51
+ @issues ||= @inspector.issues
52
+ end
54
53
 
55
- # Delegates to {Inspector#info}.
56
- #
57
- # @return [String] if given
58
- # @return [NilClass] if not given
59
- def info
60
- @info ||= @inspector.info
61
- end
54
+ # Delegates to {Inspector#info}.
55
+ #
56
+ # @return [String] if given
57
+ # @return [NilClass] if not given
58
+ def info
59
+ @info ||= @inspector.info
60
+ end
62
61
 
63
- # Delegates to {Inspector#name}.
64
- #
65
- # @return [String] if given
66
- # @return [NilClass] if not given
67
- def name
68
- @name ||= @inspector.name
69
- end
62
+ # Delegates to {Inspector#name}.
63
+ #
64
+ # @return [String] if given
65
+ # @return [NilClass] if not given
66
+ def name
67
+ @name ||= @inspector.name
70
68
  end
71
69
  end
@@ -1,63 +1,61 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ObjectInspector
4
- # ObjectInspector::CombiningFormatter implements
5
- # {ObjectInspector::BaseFormatter} to return the standard/default inspect
6
- # output format by combining Strings.
3
+ # ObjectInspector::CombiningFormatter implements
4
+ # {ObjectInspector::BaseFormatter} to return the standard/default inspect
5
+ # output format by combining Strings.
6
+ #
7
+ # @attr (see BaseFormatter)
8
+ class ObjectInspector::CombiningFormatter < ObjectInspector::BaseFormatter
9
+ # Perform the formatting routine.
7
10
  #
8
- # @attr (see BaseFormatter)
9
- class CombiningFormatter < BaseFormatter
10
- # Perform the formatting routine.
11
- #
12
- # @return [String]
13
- def call
14
- if wrapped_object_inspection_result
15
- build_wrapped_object_string
16
- else
17
- build_string
18
- end
11
+ # @return [String]
12
+ def call
13
+ if wrapped_object_inspection_result
14
+ build_wrapped_object_string
15
+ else
16
+ build_string
19
17
  end
18
+ end
20
19
 
21
- private
20
+ private
22
21
 
23
- def build_wrapped_object_string
24
- "#{build_string} "\
22
+ def build_wrapped_object_string
23
+ "#{build_string} "\
25
24
  "#{ObjectInspector.configuration.presented_object_separator} "\
26
25
  "#{wrapped_object_inspection_result}"
27
- end
26
+ end
28
27
 
29
- def build_string
30
- "<#{combine_strings}>"
31
- end
28
+ def build_string
29
+ "<#{combine_strings}>"
30
+ end
32
31
 
33
- def combine_strings
34
- strings.join
35
- end
32
+ def combine_strings
33
+ strings.join
34
+ end
36
35
 
37
- # Override in subclasses as needed.
38
- def strings
39
- [
40
- build_identification_string,
41
- build_flags_string,
42
- build_info_string,
43
- build_name_string
44
- ].compact
45
- end
36
+ # Override in subclasses as needed.
37
+ def strings
38
+ [
39
+ build_identification_string,
40
+ build_flags_string,
41
+ build_info_string,
42
+ build_name_string,
43
+ ].compact
44
+ end
46
45
 
47
- def build_identification_string
48
- identification.to_s
49
- end
46
+ def build_identification_string
47
+ identification.to_s
48
+ end
50
49
 
51
- def build_flags_string
52
- "(#{flags.to_s.upcase})" if flags
53
- end
50
+ def build_flags_string
51
+ "(#{flags.to_s.upcase})" if flags
52
+ end
54
53
 
55
- def build_info_string
56
- " #{info}" if info
57
- end
54
+ def build_info_string
55
+ " #{info}" if info
56
+ end
58
57
 
59
- def build_name_string
60
- " :: #{name}" if name
61
- end
58
+ def build_name_string
59
+ " :: #{name}" if name
62
60
  end
63
61
  end