Class: ObjectIdentifier::StringFormatter::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/object_identifier/formatters/string_formatter.rb

Overview

ObjectIdentifier::StringFormatter::Item formats a single-object-specific identification String.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, parameters) ⇒ Item

Returns a new instance of Item.

Parameters:



91
92
93
94
# File 'lib/object_identifier/formatters/string_formatter.rb', line 91

def initialize(object, parameters)
  @object = object
  @parameters = parameters
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



85
86
87
# File 'lib/object_identifier/formatters/string_formatter.rb', line 85

def object
  @object
end

#parametersObject (readonly)

Returns the value of attribute parameters.



85
86
87
# File 'lib/object_identifier/formatters/string_formatter.rb', line 85

def parameters
  @parameters
end

Instance Method Details

#callString

Returns The self-identifying String for #object.

Returns:

  • (String)

    The self-identifying String for #object.



97
98
99
100
101
# File 'lib/object_identifier/formatters/string_formatter.rb', line 97

def call
  return NO_OBJECTS_INDICATOR if blank?

  "#{class_name}[#{formatted_attributes}]"
end