Class: ObjectIdentifier::StringFormatter::Item
- Defined in:
- lib/object_identifier/formatters/string_formatter.rb
Overview
ObjectIdentifier::StringFormatter::Item formats a single-object-specific identification String.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Instance Method Summary collapse
-
#call ⇒ String
The self-identifying String for #object.
-
#initialize(object, parameters) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(object, parameters) ⇒ Item
Returns a new instance of Item.
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
#object ⇒ Object (readonly)
Returns the value of attribute object.
85 86 87 |
# File 'lib/object_identifier/formatters/string_formatter.rb', line 85 def object @object end |
#parameters ⇒ Object (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
#call ⇒ String
Returns 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 |