Class: Set

Inherits:
Object show all
Defined in:
lib/volt/reactive/dependency.rb

Instance Method Summary collapse

Instance Method Details

#delete(o) ⇒ Object



5
6
7
# File 'lib/volt/reactive/dependency.rb', line 5

def delete(o)
  @hash.delete(o)
end

#delete?(o) ⇒ Boolean

Returns:



9
10
11
12
13
14
15
# File 'lib/volt/reactive/dependency.rb', line 9

def delete?(o)
  if include?(o)
    delete(o)
  else
    nil
  end
end

#delete_ifObject



17
18
19
20
21
22
23
# File 'lib/volt/reactive/dependency.rb', line 17

def delete_if
  block_given? or return enum_for(__method__)
  # @hash.delete_if should be faster, but using it breaks the order
  # of enumeration in subclasses.
  select { |o| yield o }.each { |o| @hash.delete(o) }
  self
end

#to_aObject



25
26
27
# File 'lib/volt/reactive/dependency.rb', line 25

def to_a
  @hash.keys
end