Class: ObjectInspector::Configuration
- Inherits:
-
Object
- Object
- ObjectInspector::Configuration
- Defined in:
- lib/object_inspector.rb
Overview
ObjectInspector::Configuration stores the default configuration options for the ObjectInspector gem. Modification of attributes is possible at any time, and values will persist for the duration of the running process.
Instance Attribute Summary collapse
-
#default_scope ⇒ Object
Returns the value of attribute default_scope.
-
#flags_separator ⇒ Object
Returns the value of attribute flags_separator.
-
#formatter_class ⇒ Object
Returns the value of attribute formatter_class.
-
#info_separator ⇒ Object
Returns the value of attribute info_separator.
-
#inspect_method_prefix ⇒ Object
Returns the value of attribute inspect_method_prefix.
-
#issues_separator ⇒ Object
Returns the value of attribute issues_separator.
-
#name_separator ⇒ Object
Returns the value of attribute name_separator.
-
#out_of_scope_placeholder ⇒ Object
Returns the value of attribute out_of_scope_placeholder.
-
#presented_object_separator ⇒ Object
Returns the value of attribute presented_object_separator.
-
#wild_card_scope ⇒ Object
Returns the value of attribute wild_card_scope.
Instance Method Summary collapse
- #disable ⇒ Object
- #disabled? ⇒ Boolean
- #enable ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
rubocop:disable Metrics/MethodLength.
- #toggle ⇒ Object
Constructor Details
#initialize ⇒ Configuration
rubocop:disable Metrics/MethodLength
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/object_inspector.rb', line 39 def initialize # rubocop:disable Metrics/MethodLength @enabled = true @formatter_class = TemplatingFormatter @inspect_method_prefix = "inspect" @default_scope = Scope.new(:self) @wild_card_scope = "all" @out_of_scope_placeholder = "*" @presented_object_separator = " #{[0x21E8].pack("U")} " @name_separator = " - " @flags_separator = " / " @issues_separator = " | " @info_separator = " | " end |
Instance Attribute Details
#default_scope ⇒ Object
Returns the value of attribute default_scope.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def default_scope @default_scope end |
#flags_separator ⇒ Object
Returns the value of attribute flags_separator.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def flags_separator @flags_separator end |
#formatter_class ⇒ Object
Returns the value of attribute formatter_class.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def formatter_class @formatter_class end |
#info_separator ⇒ Object
Returns the value of attribute info_separator.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def info_separator @info_separator end |
#inspect_method_prefix ⇒ Object
Returns the value of attribute inspect_method_prefix.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def inspect_method_prefix @inspect_method_prefix end |
#issues_separator ⇒ Object
Returns the value of attribute issues_separator.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def issues_separator @issues_separator end |
#name_separator ⇒ Object
Returns the value of attribute name_separator.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def name_separator @name_separator end |
#out_of_scope_placeholder ⇒ Object
Returns the value of attribute out_of_scope_placeholder.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def out_of_scope_placeholder @out_of_scope_placeholder end |
#presented_object_separator ⇒ Object
Returns the value of attribute presented_object_separator.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def presented_object_separator @presented_object_separator end |
#wild_card_scope ⇒ Object
Returns the value of attribute wild_card_scope.
28 29 30 |
# File 'lib/object_inspector.rb', line 28 def wild_card_scope @wild_card_scope end |
Instance Method Details
#disable ⇒ Object
63 64 65 66 |
# File 'lib/object_inspector.rb', line 63 def disable @enabled = false puts(" -> ObjectInspector disabled") end |
#disabled? ⇒ Boolean
61 |
# File 'lib/object_inspector.rb', line 61 def disabled? = !enabled? |
#enable ⇒ Object
56 57 58 59 |
# File 'lib/object_inspector.rb', line 56 def enable @enabled = true puts(" -> ObjectInspector enabled") end |
#enabled? ⇒ Boolean
54 |
# File 'lib/object_inspector.rb', line 54 def enabled? = @enabled |
#toggle ⇒ Object
53 |
# File 'lib/object_inspector.rb', line 53 def toggle = enabled? ? disable : enable |