lib/banken/error.rb in banken-0.0.1 vs lib/banken/error.rb in banken-0.1.1

- old
+ new

@@ -1,26 +1,26 @@ module Banken class Error < StandardError; end class NotAuthorizedError < Error - attr_reader :controller, :action, :policy + attr_reader :controller, :query, :loyalty def initialize(options={}) if options.is_a? String message = options else @controller = options[:controller] - @action = options[:action] - @policy = options[:policy] + @query = options[:query] + @loyalty = options[:loyalty] - message = options.fetch(:message) { "not allowed to #{action} of #{controller} by #{policy.inspect}" } + message = options.fetch(:message) { "not allowed to #{query} of #{controller} by #{loyalty.inspect}" } end super(message) end end class NotDefinedError < Error; end class AuthorizationNotPerformedError < Error; end - class PolicyScopingNotPerformedError < AuthorizationNotPerformedError; end + class LoyaltyScopingNotPerformedError < AuthorizationNotPerformedError; end end