Class: Attachs::Interpolations

Inherits:
Object
  • Object
show all
Defined in:
lib/attachs/interpolations.rb

Instance Method Summary collapse

Instance Method Details

#add(name, &block) ⇒ Object



12
13
14
# File 'lib/attachs/interpolations.rb', line 12

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

#find(name) ⇒ Object



4
5
6
7
8
9
10
# 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