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.push  
          instance_eval &block if block_given?
          blocks.each{|b| instance_eval &b}
          settings.pop   
          reset_validations!
        else
          instance_eval &block
        end
      end
def nest ( * blocks , & block ) blocks . reject! { | b | b . nil? } if blocks . any? settings . push instance_eval & block if block_given? blocks . each { | b | instance_eval & b } settings . pop reset_validations! 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 .
# create a new context to eval the follow # when finished, we pop the context
blocks
<not_specific>
block
<not_specific>