Module: Wayfarer::KV Private

Included in:
Routing::PathFinder, Task
Defined in:
lib/wayfarer/kv.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides a key-value store via [] and []=.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns value associated with the key or nil.

Parameters:

  • key (Object)

    key to fetch

Returns:

  • (Object, nil)

    value associated with the key or nil



10
11
12
# File 'lib/wayfarer/kv.rb', line 10

def [](key)
  kv[key]
end

#[]=(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns value that was set.

Parameters:

  • key (Object)

    key to set

  • value (Object)

    value to set

Returns:

  • (Object)

    value that was set



17
18
19
# File 'lib/wayfarer/kv.rb', line 17

def []=(key, value)
  kv[key] = value
end