Sha256: 1557bb22d775c7323d329561bf0322ead5bf81f76836167ac39be9424d01fe69
Contents?: true
Size: 887 Bytes
Versions: 11
Compression:
Stored size: 887 Bytes
Contents
module Arrthorizer module Rails class ControllerConfiguration Error = Class.new(Arrthorizer::ArrthorizerException) def initialize(&block) yield self rescue LocalJumpError raise Error, "No builder block provided to ContextBuilder.new" end def defaults(&block) self.defaults_block = block end def for_action(*actions, &block) actions.each do |action| add_action_block(action, &block) end end alias_method :for_actions, :for_action def block_for(action) action_blocks.fetch(action) { defaults_block } end private attr_accessor :defaults_block def add_action_block(action, &block) action_blocks[action] = block end def action_blocks @action_blocks ||= HashWithIndifferentAccess.new end end end end
Version data entries
11 entries across 11 versions & 1 rubygems