Sha256: 9df7832e30c947b36035213416e3eb52c453452c0a530e2cff6df22613974295

Contents?: true

Size: 716 Bytes

Versions: 42

Compression:

Stored size: 716 Bytes

Contents

# DestructiveMethods tracks the names of all methods that are marked as 
# destructive.  This lets us do an optimization where we don't need to 
# check any methods with names that aren't here, we can be sure that they
# are not destructive.  If the method is tracked here, we need to check
# it on its current class.
class DestructiveMethods
  @@method_names = {}
  
  def self.add_method(method_name)
    @@method_names[method_name] = true
  end
  
  # Check to see if a method might be destructive.  If this returns
  # false, then we can guarentee that it won't be destructive and
  # we can skip a destructive check.
  def self.might_be_destructive?(method_name)
    return @@method_names[method_name]
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
volt-0.6.5 lib/volt/reactive/destructive_methods.rb
volt-0.6.4 lib/volt/reactive/destructive_methods.rb
volt-0.6.3 lib/volt/reactive/destructive_methods.rb
volt-0.6.2 lib/volt/reactive/destructive_methods.rb
volt-0.6.1 lib/volt/reactive/destructive_methods.rb
volt-0.6.0 lib/volt/reactive/destructive_methods.rb
volt-0.5.18 lib/volt/reactive/destructive_methods.rb
volt-0.5.17 lib/volt/reactive/destructive_methods.rb
volt-0.5.16 lib/volt/reactive/destructive_methods.rb
volt-0.5.15 lib/volt/reactive/destructive_methods.rb
volt-0.5.14 lib/volt/reactive/destructive_methods.rb
volt-0.5.13 lib/volt/reactive/destructive_methods.rb
volt-0.5.12 lib/volt/reactive/destructive_methods.rb
volt-0.5.11 lib/volt/reactive/destructive_methods.rb
volt-0.5.10 lib/volt/reactive/destructive_methods.rb
volt-0.5.9 lib/volt/reactive/destructive_methods.rb
volt-0.5.8 lib/volt/reactive/destructive_methods.rb
volt-0.5.7 lib/volt/reactive/destructive_methods.rb
volt-0.5.6 lib/volt/reactive/destructive_methods.rb
volt-0.5.4 lib/volt/reactive/destructive_methods.rb