Class: RedfishClient::NilHash
- Inherits:
-
Object
- Object
- RedfishClient::NilHash
- Defined in:
- lib/redfish_client/nil_hash.rb
Overview
NilHash imitates the built-in Hash class without storing anything permanently.
Main use of this class is as a non-caching connector backend.
Instance Method Summary collapse
-
#[](_key) ⇒ nil
Access hash member.
-
#[]=(_key, value) ⇒ Object
Set hash member.
-
#clear ⇒ Object
Clear the contents of the cache.
-
#delete(_key) ⇒ Object
Delete entry from hash.
Instance Method Details
#[](_key) ⇒ nil
Access hash member.
Since this implementation does not store any data, return value is always nil.
16 17 18 |
# File 'lib/redfish_client/nil_hash.rb', line 16 def [](_key) nil end |
#[]=(_key, value) ⇒ Object
Set hash member.
This is just a pass-through method, since it always simply returns the value without actually storing it.
28 29 30 |
# File 'lib/redfish_client/nil_hash.rb', line 28 def []=(_key, value) value end |
#clear ⇒ Object
Clear the contents of the cache.
Since hash is not storing anything, this is a no-op.
35 |
# File 'lib/redfish_client/nil_hash.rb', line 35 def clear; end |
#delete(_key) ⇒ Object
Delete entry from hash.
Since hash is not storing anything, this is a no-op.
42 |
# File 'lib/redfish_client/nil_hash.rb', line 42 def delete(_key) end |