Class: Toys::UniqueKey

Inherits:
Object
  • Object
show all
Defined in:
core-docs/toys/unique_key.rb

Overview

A named unique key, useful for Context keys or sentinels.

Each individual instance of this class is unique and not equal to any other instance, even if they have the same user-visible name.

Defined in the toys-core gem

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ UniqueKey

Create a new UniqueKey.

Parameters:

  • name (String, nil) (defaults to: nil) —

    Optional name. If not passed, a default is constructed using the object ID.



17
18
19
# File 'core-docs/toys/unique_key.rb', line 17

def initialize(name = nil)
  # Source available in the toys-core gem
end

Instance Method Details

#inspect ⇒ String

Returns a user-visible name of this key.

Returns:

  • (String) —

    a user-visible name of this key



31
32
33
# File 'core-docs/toys/unique_key.rb', line 31

def inspect
  # Source available in the toys-core gem
end

#to_s ⇒ String

Returns a user-visible name of this key.

Returns:

  • (String) —

    a user-visible name of this key



24
25
26
# File 'core-docs/toys/unique_key.rb', line 24

def to_s
  # Source available in the toys-core gem
end