Sha256: da6d9015abdd4ca884c972fb3e6ccc7164bca8fe72e5870b3356fdd7da012dc6

Contents?: true

Size: 637 Bytes

Versions: 45

Compression:

Stored size: 637 Bytes

Contents

# Some template bindings share the controller with other template bindings based
# on a name.  This class creates a cache based on the group_controller name and the
# controller class.
module Volt
  class GroupedControllers
    def initialize(name)
      @name = name
      @@pool ||= GenericCountingPool.new
    end

    def lookup_or_create(controller, &block)
      @@pool.find(@name, controller, &block)
    end

    def remove(controller)
      @@pool.remove(@name, controller)
    end

    def clear
      @@pool.clear
    end

    def inspect
      "<GroupedController @name:#{@name.inspect} #{@@pool.inspect}>"
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.7.pre7 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.7.pre6 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.7.pre5 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.7.pre3 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.7.pre2 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.6 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.6.pre3 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.6.pre2 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.6.pre1 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre12 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre11 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre9 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre8 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre7 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre6 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre5 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre4 lib/volt/page/bindings/view_binding/grouped_controllers.rb
volt-0.9.5.pre3 lib/volt/page/bindings/view_binding/grouped_controllers.rb