Sha256: dcd1f4e99bc93bdb5c26ab799a4446e21bc7a461c06871fbfbea9d8ddf4da97e
Contents?: true
Size: 1.5 KB
Versions: 3
Compression:
Stored size: 1.5 KB
Contents
module ObjectInspector # 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. # # @attr inspector [ObjectInspector::Inspector] class BaseFormatter RIGHT_ARROW_ICON = [0x21E8].pack("U").freeze attr_reader :inspector def initialize(inspector) @inspector = inspector end # Perform the formatting routine. # # @return [String] def call raise NotImplementedError end # Delegates to {Inspector#wrapped_object_inspection}. # # @return [String] if given # @return [NilClass] if not given def wrapped_object_inspection @wrapped_object_inspection ||= inspector.wrapped_object_inspection end # Delegates to {Inspector#identification}. # # @return [String] if given def identification @identification ||= inspector.identification end # Delegates to {Inspector#flags}. # # @return [String] if given # @return [NilClass] if not given def flags @flags ||= inspector.flags end # Delegates to {Inspector#info}. # # @return [String] if given # @return [NilClass] if not given def info @info ||= inspector.info end # Delegates to {Inspector#name}. # # @return [String] if given # @return [NilClass] if not given def name @name ||= inspector.name end end end
Version data entries
3 entries across 3 versions & 1 rubygems