Sha256: f0738c54699ed4e3849e317e0d5eaf048c27fd201a8fe191aa96c5902c2aa1d8

Contents?: true

Size: 563 Bytes

Versions: 68

Compression:

Stored size: 563 Bytes

Contents

module Volt
  class HashDependency
    def initialize
      @hash_depedencies = {}
    end

    def depend(key)
      ensure_key(key).depend
    end

    def changed!(key)
      ensure_key(key).changed!
    end

    def delete(key)
      dep = @hash_depedencies.delete(key)

      if dep
        dep.changed!
        dep.remove
      end
    end

    def changed_all!
      @hash_depedencies.each_pair do |key, value|
        value.changed!
      end
    end

    private

    def ensure_key(key)
      @hash_depedencies[key] ||= Dependency.new
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/reactive/hash_dependency.rb
volt-0.9.7.pre7 lib/volt/reactive/hash_dependency.rb
volt-0.9.7.pre6 lib/volt/reactive/hash_dependency.rb
volt-0.9.7.pre5 lib/volt/reactive/hash_dependency.rb
volt-0.9.7.pre3 lib/volt/reactive/hash_dependency.rb
volt-0.9.7.pre2 lib/volt/reactive/hash_dependency.rb
volt-0.9.6 lib/volt/reactive/hash_dependency.rb
volt-0.9.6.pre3 lib/volt/reactive/hash_dependency.rb
volt-0.9.6.pre2 lib/volt/reactive/hash_dependency.rb
volt-0.9.6.pre1 lib/volt/reactive/hash_dependency.rb
volt-0.9.5 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre12 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre11 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre9 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre8 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre7 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre6 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre5 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre4 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre3 lib/volt/reactive/hash_dependency.rb