Sha256: 11c109d2405db392fdd6c824ed7d7148ee72fa3eaae5f083ff8f22b8340fd82d

Contents?: true

Size: 328 Bytes

Versions: 4

Compression:

Stored size: 328 Bytes

Contents

module Attachs
  class Interpolations

    def find(name)
      if registry.has_key?(name)
        registry[name]
      else
        raise "Interpolation #{name} not found"
      end
    end

    def add(name, &block)
      registry[name] = block
    end

    private

    def registry
      @registry ||= {}
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachs-4.0.0.5 lib/attachs/interpolations.rb
attachs-4.0.0.4 lib/attachs/interpolations.rb
attachs-4.0.0.3 lib/attachs/interpolations.rb
attachs-4.0.0.2 lib/attachs/interpolations.rb