Class: ObjectIdentifier::StringFormatter::SingleObject
- Defined in:
- lib/object_identifier/formatters/string_formatter.rb
Overview
ObjectIdentifier::StringFormatter::SingleObject formats a single-object-specific identification String.
Class Method Summary collapse
-
.call(*args) ⇒ String
The self-identifying String for the passed in object.
Instance Method Summary collapse
-
#call ⇒ String
The self-identifying String for @object.
-
#initialize(object, parameters) ⇒ SingleObject
constructor
A new instance of SingleObject.
Constructor Details
#initialize(object, parameters) ⇒ SingleObject
Returns a new instance of SingleObject.
103 104 105 106 |
# File 'lib/object_identifier/formatters/string_formatter.rb', line 103 def initialize(object, parameters) @object = object @parameters = parameters end |
Class Method Details
.call(*args) ⇒ String
Returns the self-identifying String for the passed in object.
96 97 98 |
# File 'lib/object_identifier/formatters/string_formatter.rb', line 96 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ String
Returns the self-identifying String for @object.
109 110 111 112 113 |
# File 'lib/object_identifier/formatters/string_formatter.rb', line 109 def call return NO_OBJECTS_INDICATOR if blank? "#{class_name}[#{formatted_attributes}]" end |