class ObjectInspector::BaseFormatter
ObjectInspector::BaseFormatter
is an abstract base class that interfaces with {ObjectInspector::Inspector} objects to combine the supplied {#identification}, {#flags}, {#info}, and {#name} strings into a friendly “inspect” String.
Attributes
Public Class Methods
@param inspector [ObjectInspector::Inspector]
# File lib/object_inspector/formatters/base_formatter.rb, line 12 def initialize(inspector) @inspector = inspector end
Public Instance Methods
Perform the formatting routine.
@return [String]
# File lib/object_inspector/formatters/base_formatter.rb, line 19 def call raise NotImplementedError end
Delegates to {Inspector#flags}.
@return [String] if given @return [NilClass] if not given
# File lib/object_inspector/formatters/base_formatter.rb, line 43 def flags @flags ||= @inspector.flags end
Delegates to {Inspector#identification}.
@return [String] if given
# File lib/object_inspector/formatters/base_formatter.rb, line 35 def identification @identification ||= @inspector.identification end
Delegates to {Inspector#info}.
@return [String] if given @return [NilClass] if not given
# File lib/object_inspector/formatters/base_formatter.rb, line 59 def info @info ||= @inspector.info end
Delegates to {Inspector#issues}.
@return [String] if given @return [NilClass] if not given
# File lib/object_inspector/formatters/base_formatter.rb, line 51 def issues @issues ||= @inspector.issues end
Delegates to {Inspector#name}.
@return [String] if given @return [NilClass] if not given
# File lib/object_inspector/formatters/base_formatter.rb, line 67 def name @name ||= @inspector.name end
Delegates to {Inspector#wrapped_object_inspection_result}.
@return [String] if given @return [NilClass] if not given
# File lib/object_inspector/formatters/base_formatter.rb, line 27 def wrapped_object_inspection_result @wrapped_object_inspection_result ||= @inspector.wrapped_object_inspection_result end