lib/grape/api.rb
# Execute first the provided block, then each of the
# block passed in. Allows for simple 'before' setups
# of settings stack pushes.
Execute first the provided block, then each of the
block passed in. Allows for simple 'before' setups
of settings stack pushes.
Execute first the provided block then each of the block passed in . Allows for simple ' before ' setups of settings stack pushes .
def nest(*blocks, &block)
        blocks.reject!{|b| b.nil?}
        if blocks.any?
          settings_stack << {}
          instance_eval &block
          blocks.each{|b| instance_eval &b}
          settings_stack.pop
        else
          instance_eval &block
        end
      end
def nest ( * blocks , & block ) blocks . reject! { | b | b . nil? } if blocks . any? settings_stack << { } instance_eval & block blocks . each { | b | instance_eval & b } settings_stack . pop else instance_eval & block end end
Execute first the provided block, then each of the
block passed in.
Execute first the provided block then each of the block passed in .
blocks
<not_specific>
block
<not_specific>