Module: Dekoden::Helpers

Defined in:
lib/dekoden.rb

Class Method Summary collapse

Class Method Details

.wrap(decorators, *args, blk, &block) ⇒ Object



91
92
93
94
95
96
97
98
99
# File 'lib/dekoden.rb', line 91

def self.wrap(decorators, *args, blk, &block)
  if decorator = decorators.first
    decorator.call(*args, blk) do |*args, blk|
      wrap(decorators.drop(1), *args, blk, &block)
    end
  else
    block.call(*args, blk)
  end
end