Sha256: a153d957d392f6358007fb71505ad1e74893a8d20b632e6ce66b926db956456b

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

# ObjectIdentifier::BaseFormatter is an abstract base class for formatters.
class ObjectIdentifier::BaseFormatter
  attr_reader :objects,
              :parameters

  # A shortcut for calling `new(...).call`.
  def self.call(...)
    new(...).call
  end

  # @param objects [Object, [Object, ...]] The object(s) to be interrogated for
  #   String values to be added to the output String.
  # @param parameters [ObjectIdentifier::Parameters]
  def initialize(objects, parameters: ObjectIdentifier::Parameters.build)
    @objects = ObjectIdentifier::ArrayWrap.(objects)
    @parameters = parameters
  end

  def call
    raise NotImplementedError
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
object_identifier-0.9.0 lib/object_identifier/formatters/base_formatter.rb
object_identifier-0.8.0 lib/object_identifier/formatters/base_formatter.rb
object_identifier-0.7.0 lib/object_identifier/formatters/base_formatter.rb