Module: VarBlock::GetvarHandlers::ProcHandler

Defined in:
lib/var_block/getvar_handlers.rb

Class Method Summary collapse

Class Method Details

.handle(value, context, options = []) ⇒ Object

Raises:

  • (ArgumentError)


18
19
20
21
22
23
# File 'lib/var_block/getvar_handlers.rb', line 18

def self.handle(value, context, options = [])
  supported_options = []
  unsupported_options = options - supported_options
  raise ArgumentError, "#{unsupported_options.map(&:inspect).join(', ')} option(s) are not supported on non-merged variables" if unsupported_options.any?
  context.instance_exec(&value)
end