Class: Proc

Inherits:
Object show all
Defined in:
lib/robot-army/ruby2ruby_ext.rb

Instance Method Summary collapse

Instance Method Details

#argumentsObject



2
3
4
# File 'lib/robot-army/ruby2ruby_ext.rb', line 2

def arguments
  (to_ruby[/\Aproc \{ \|([^\|]+)\|/, 1] || '').split(/\s*,\s*/)
end

#to_ruby_without_proc_wrapperObject



6
7
8
# File 'lib/robot-army/ruby2ruby_ext.rb', line 6

def to_ruby_without_proc_wrapper
  to_ruby[/\Aproc\s*\{\s*(\|[^\|]+\|)?\s*(.*?)\s*\}\Z/m, 2] || raise("Unable to parse proc's Ruby: #{to_ruby}")
end