Class: Holidays::Definition::Decorator::CustomMethodProc

Inherits:
Object
  • Object
show all
Defined in:
lib/holidays/definition/decorator/custom_method_proc.rb

Instance Method Summary collapse

Instance Method Details

#call(proc) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/holidays/definition/decorator/custom_method_proc.rb', line 5

def call(proc)
  validate!(proc)

  eval("Proc.new { |#{parse_arguments(proc.arguments)}|
       #{proc.source}
  }")
end