class RedfishClient::NilHash

NilHash imitates the built-in Hash class without storing anything permanently.

Main use of this class is as a non-caching connector backend.

Public Instance Methods

[](_key) click to toggle source

Access hash member.

Since this implementation does not store any data, return value is always nil.

@param _key not used @return [nil]

# File lib/redfish_client/nil_hash.rb, line 16
def [](_key)
  nil
end
[]=(_key, value) click to toggle source

Set hash member.

This is just a pass-through method, since it always simply returns the value without actually storing it.

@param _key not used @param value [Object] any value @return [Object] value

# File lib/redfish_client/nil_hash.rb, line 28
def []=(_key, value)
  value
end
clear() click to toggle source

Clear the contents of the cache.

Since hash is not storing anything, this is a no-op.

# File lib/redfish_client/nil_hash.rb, line 35
def clear; end
delete(_key) click to toggle source

Delete entry from hash.

Since hash is not storing anything, this is a no-op.

@param _key not used

# File lib/redfish_client/nil_hash.rb, line 42
def delete(_key) end