Method: Byebug::Setting.find

Defined in:
lib/byebug/setting.rb

.find(shortcut) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/byebug/setting.rb', line 54

def find(shortcut)
  abbr = /^no/.match?(shortcut) ? shortcut[2..-1] : shortcut
  matches = settings.select do |key, value|
    key =~ (value.boolean? ? /#{abbr}/ : /#{shortcut}/)
  end
  matches.size == 1 ? matches.values.first : nil
end