1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

look for a setter before anything else in Pry::Config#method_missing().

This commit is contained in:
Robert Gleeson 2014-01-19 04:12:39 +01:00
parent 358395435b
commit f4462a48cc

View file

@ -25,13 +25,13 @@ class Pry::Config
def method_missing(name, *args, &block)
key = name.to_s
if @lookup.has_key?(key)
if key[-1] == "="
short_key = key.to_s[0..-2]
@lookup[short_key] = args[0]
elsif @lookup.has_key?(key)
@lookup[key]
elsif @default.respond_to?(name)
@default.public_send(name, *args, &block)
elsif key[-1] == "="
short_key = key.to_s[0..-2]
@lookup[short_key] = args[0]
else
nil
end