Instead of 'verify', check param keys.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
License.txt
README.rdoc
Rakefile
assumption.gemspec

README.rdoc

assumption

Instead of verify, Assumption check params. Assumption check nested params and work with interrupting block.

class UsersController
  assume :include => {:user => [:nickname, :email]}, :only => [:new, :create] do
    raise Service::BadRequest
  end

  assume :exclude => {:user => :email}, :only => [:update] do
    raise Service::BadRequest 
  end
end

Assumption::ActionController.interrupt is accessor for default interruption

Assumption::ActionController.interrupt = Proc.new { raise Service::BadRequest }
class UsersController
  assume :include => {:user => [:nickname, :email]}, :only => [:new, :create]
end

Copyright

Copyright © 2012 morita shingo. See License.txt fo further details.