mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Simplify
By putting the check for [] first, we don't need to handle the case where that's part of the method.
This commit is contained in:
parent
5717ff487b
commit
4cf1d05034
1 changed files with 3 additions and 8 deletions
|
@ -47,17 +47,12 @@ class Pry
|
|||
elsif name.to_s =~ /(.+)\#(\S+)\Z/
|
||||
context, meth_name = $1, $2
|
||||
from_module(target.eval(context), meth_name, target)
|
||||
elsif name.to_s =~ /(.+)(\.|::)(\S+)\Z/
|
||||
if($3 == "new[]")
|
||||
name.to_s =~ /(.+)(\[\])\Z/
|
||||
context, meth_name = $1, $2
|
||||
else
|
||||
context, meth_name = $1, $3
|
||||
end
|
||||
from_obj(target.eval(context), meth_name, target)
|
||||
elsif name.to_s =~ /(.+)(\[\])\Z/
|
||||
context, meth_name = $1, $2
|
||||
from_obj(target.eval(context), meth_name, target)
|
||||
elsif name.to_s =~ /(.+)(\.|::)(\S+)\Z/
|
||||
context, meth_name = $1, $3
|
||||
from_obj(target.eval(context), meth_name, target)
|
||||
elsif options[:instance]
|
||||
from_module(target.eval("self"), name, target)
|
||||
elsif options[:methods]
|
||||
|
|
Loading…
Reference in a new issue