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

inspector[R]

Public Class Methods

new(inspector) click to toggle source

@param inspector [ObjectInspector::Inspector]

# File lib/object_inspector/formatters/base_formatter.rb, line 12
def initialize(inspector)
  @inspector = inspector
end

Public Instance Methods

call() click to toggle source

Perform the formatting routine.

@return [String]

# File lib/object_inspector/formatters/base_formatter.rb, line 19
def call
  raise NotImplementedError
end
flags() click to toggle source

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
identification() click to toggle source

Delegates to {Inspector#identification}.

@return [String] if given

# File lib/object_inspector/formatters/base_formatter.rb, line 35
def identification
  @identification ||= @inspector.identification
end
info() click to toggle source

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
issues() click to toggle source

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
name() click to toggle source

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
wrapped_object_inspection_result() click to toggle source

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