class Attachs::Interpolations

Public Instance Methods

add(name, &block) click to toggle source
# File lib/attachs/interpolations.rb, line 12
def add(name, &block)
  registry[name] = block
end
find(name) click to toggle source
# File lib/attachs/interpolations.rb, line 4
def find(name)
  if registry.has_key?(name)
    registry[name]
  else
    raise "Interpolation #{name} not found"
  end
end

Private Instance Methods

registry() click to toggle source
# File lib/attachs/interpolations.rb, line 18
def registry
  @registry ||= {}
end