Class: ObjectIdentifier::BaseFormatter
- Defined in:
- lib/object_identifier/formatters/base_formatter.rb
Overview
ObjectIdentifier::BaseFormatter is an abstract base class for formatters.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Class Method Summary collapse
-
.call ⇒ Object
A shortcut for calling ‘new(…).call`.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(objects, parameters: ObjectIdentifier::Parameters.build) ⇒ BaseFormatter
constructor
A new instance of BaseFormatter.
Constructor Details
#initialize(objects, parameters: ObjectIdentifier::Parameters.build) ⇒ BaseFormatter
Returns a new instance of BaseFormatter.
16 17 18 19 |
# File 'lib/object_identifier/formatters/base_formatter.rb', line 16 def initialize(objects, parameters: ObjectIdentifier::Parameters.build) @objects = ObjectIdentifier::ArrayWrap.(objects) @parameters = parameters end |
Instance Attribute Details
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
5 6 7 |
# File 'lib/object_identifier/formatters/base_formatter.rb', line 5 def objects @objects end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
5 6 7 |
# File 'lib/object_identifier/formatters/base_formatter.rb', line 5 def parameters @parameters end |
Class Method Details
.call ⇒ Object
A shortcut for calling ‘new(…).call`.
9 10 11 |
# File 'lib/object_identifier/formatters/base_formatter.rb', line 9 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'lib/object_identifier/formatters/base_formatter.rb', line 21 def call raise NotImplementedError end |