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.5.pre2 lib/volt/reactive/hash_dependency.rb
volt-0.9.5.pre1 lib/volt/reactive/hash_dependency.rb
volt-0.9.4 lib/volt/reactive/hash_dependency.rb
volt-0.9.4.pre5 lib/volt/reactive/hash_dependency.rb
volt-0.9.4.pre3 lib/volt/reactive/hash_dependency.rb
volt-0.9.4.pre2 lib/volt/reactive/hash_dependency.rb
volt-0.9.4.pre1 lib/volt/reactive/hash_dependency.rb
volt-0.9.3 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre6 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre5 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre4 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre3 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre2 lib/volt/reactive/hash_dependency.rb
volt-0.9.3.pre1 lib/volt/reactive/hash_dependency.rb
volt-0.9.2 lib/volt/reactive/hash_dependency.rb
volt-0.9.1 lib/volt/reactive/hash_dependency.rb
volt-0.9.1.pre5 lib/volt/reactive/hash_dependency.rb
volt-0.9.1.pre4 lib/volt/reactive/hash_dependency.rb
volt-0.9.1.pre3 lib/volt/reactive/hash_dependency.rb
volt-0.9.1.pre2 lib/volt/reactive/hash_dependency.rb