public Method

Kernel.extract_options_from_args!(args)

Extracts an options hash if it is the last item in the args array Used internally in methods that take *args

Example

def render(*args,&blk)
  opts = extract_options_from_args!(args) || {}

Source Code

# File merb/core_ext/kernel.rb, line 228
def extract_options_from_args!(args)
  args.pop if Hash === args.last
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.