Module: Pry::Config::Convenience

Included in:
Pry
Defined in:
lib/pry/config/convenience.rb

Constant Summary collapse

SHORTCUTS =
[
 :input,
 :output,
 :commands,
 :print,
 :exception_handler,
 :hooks,
 :color,
 :pager,
 :editor,
 :memory_size,
 :extra_sticky_locals
]

Instance Method Summary collapse

Instance Method Details

#config_shortcut(*names) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/pry/config/convenience.rb', line 17

def config_shortcut(*names)
  names.each do |name|
    reader = name
    setter = "#{name}="
    define_method(reader) { config.public_send(name) }
    define_method(setter) { |value| config.public_send(setter, value) }
  end
end