Class: Ori::LazyHashSet
Constant Summary
collapse
- INIT =
proc { Hash.new { |hash, key| hash[key] = Set.new } }
Instance Method Summary
collapse
#any?, #delete_if, #each, #empty?
Methods inherited from Lazy
#initialized?, #internal
Constructor Details
Returns a new instance of LazyHashSet.
135
136
137
|
# File 'lib/ori/lazy.rb', line 135
def initialize
super(INIT)
end
|
Instance Method Details
#[](key) ⇒ Object
139
140
141
|
# File 'lib/ori/lazy.rb', line 139
def [](key)
internal[key]
end
|
#[]=(key, value) ⇒ Object
143
144
145
|
# File 'lib/ori/lazy.rb', line 143
def []=(key, value)
internal[key] = value
end
|
#delete(key) ⇒ Object
159
160
161
|
# File 'lib/ori/lazy.rb', line 159
def delete(key)
internal.delete(key) if initialized?
end
|
#keys ⇒ Object
153
154
155
156
157
|
# File 'lib/ori/lazy.rb', line 153
def keys
return [] unless initialized?
internal.keys
end
|
#none?(&block) ⇒ Boolean
147
148
149
150
151
|
# File 'lib/ori/lazy.rb', line 147
def none?(&block)
return true unless initialized?
internal.none?(&block)
end
|