Class: Blocks::InvalidPermissionsHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/blocks/experimental/invalid_permissions_handler.rb

Constant Summary collapse

LOG =
:log
RAISE =
:raise

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ InvalidPermissionsHandler

Returns a new instance of InvalidPermissionsHandler.



13
14
15
# File 'lib/blocks/experimental/invalid_permissions_handler.rb', line 13

def initialize(message)
  send("handle_#{Blocks.invalid_permissions_approach}", message)
end

Class Method Details

.build(method_name, block_name) ⇒ Object



7
8
9
10
11
# File 'lib/blocks/experimental/invalid_permissions_handler.rb', line 7

def self.build(method_name, block_name)
  message = "Cannot #{method_name} #{block_name}; #{block_name} is not in the permitted_blocks list"
  new(message)
  nil
end