Class: Collection::NullHash

Inherits:
Object
  • Object
show all
Defined in:
lib/null/null_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options={})
  @title = name
end

Instance Attribute Details

#storeObject (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

#clearObject



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

Returns:

  • (Boolean)


22
23
24
# File 'lib/null/null_hash.rb', line 22

def empty?
  true
end

#fetch(key) {|key| ... } ⇒ Object

Yields:

  • (key)


15
16
17
# File 'lib/null/null_hash.rb', line 15

def fetch(key)
  yield(key) if block_given?
end

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/null/null_hash.rb', line 30

def has_key?(key)
  false
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/null/null_hash.rb', line 33

def key?(key)
  false
end

#keysObject



37
38
39
# File 'lib/null/null_hash.rb', line 37

def keys
  []
end

#sizeObject



26
27
28
# File 'lib/null/null_hash.rb', line 26

def size
  0
end

#to_hashObject



41
42
43
# File 'lib/null/null_hash.rb', line 41

def to_hash
  {}
end