Class: Method

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

Instance Method Summary collapse

Instance Method Details

#argumentsObject



12
13
14
# File 'lib/robot-army/ruby2ruby_ext.rb', line 12

def arguments
  (to_ruby[/\A(def [^\s\(]+)(?:\(([^\)]*)\))?/, 2] || '').split(/\s*,\s*/)
end

#to_ruby_without_method_declarationObject



16
17
18
# File 'lib/robot-army/ruby2ruby_ext.rb', line 16

def to_ruby_without_method_declaration
  to_ruby[/\Adef [^\s\(]+(?:\([^\)]*\))?\s*(.*?)\s*end\Z/m, 1] || raise("Unable to parse method's Ruby: #{to_ruby}")
end