Class: Collection::NullHash
- Inherits:
-
Object
- Object
- Collection::NullHash
- Defined in:
- lib/null/null_hash.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
- #clear ⇒ Object
- #delete(key) ⇒ Object
- #empty? ⇒ Boolean
- #fetch(key) {|key| ... } ⇒ Object
- #has_key?(key) ⇒ Boolean
-
#initialize(name, options = {}) ⇒ NullHash
constructor
A new instance of NullHash.
- #key?(key) ⇒ Boolean
- #keys ⇒ Object
- #size ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ NullHash
Returns a new instance of NullHash.
5 6 7 |
# File 'lib/null/null_hash.rb', line 5 def initialize(name, ={}) @title = name end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
3 4 5 |
# File 'lib/null/null_hash.rb', line 3 def store @store end |
Instance Method Details
#[](key) ⇒ Object
9 10 |
# File 'lib/null/null_hash.rb', line 9 def [](key) end |
#[]=(key, val) ⇒ Object
12 13 |
# File 'lib/null/null_hash.rb', line 12 def []=(key, val) end |
#clear ⇒ Object
45 46 |
# File 'lib/null/null_hash.rb', line 45 def clear end |
#delete(key) ⇒ Object
19 20 |
# File 'lib/null/null_hash.rb', line 19 def delete(key) end |
#empty? ⇒ Boolean
22 23 24 |
# File 'lib/null/null_hash.rb', line 22 def empty? true end |
#fetch(key) {|key| ... } ⇒ Object
15 16 17 |
# File 'lib/null/null_hash.rb', line 15 def fetch(key) yield(key) if block_given? end |
#has_key?(key) ⇒ Boolean
30 31 32 |
# File 'lib/null/null_hash.rb', line 30 def has_key?(key) false end |
#key?(key) ⇒ Boolean
33 34 35 |
# File 'lib/null/null_hash.rb', line 33 def key?(key) false end |
#keys ⇒ Object
37 38 39 |
# File 'lib/null/null_hash.rb', line 37 def keys [] end |
#size ⇒ Object
26 27 28 |
# File 'lib/null/null_hash.rb', line 26 def size 0 end |
#to_hash ⇒ Object
41 42 43 |
# File 'lib/null/null_hash.rb', line 41 def to_hash {} end |