Class: Byebug::AutoprySetting

Inherits:
Setting
  • Object
show all
Defined in:
lib/byebug/settings/autopry.rb

Overview

Setting for automatically invoking Pry on every stop.

Constant Summary collapse

DEFAULT =
0

Instance Method Summary collapse

Methods inherited from Setting

[], []=, #boolean?, find, #help, help_all, #integer?, settings, #to_s, #to_sym

Constructor Details

#initializeAutoprySetting

Returns a new instance of AutoprySetting.



13
14
15
# File 'lib/byebug/settings/autopry.rb', line 13

def initialize
  PryCommand.always_run = DEFAULT
end

Instance Method Details



17
18
19
# File 'lib/byebug/settings/autopry.rb', line 17

def banner
  "Invoke Pry on every stop"
end

#valueObject



25
26
27
# File 'lib/byebug/settings/autopry.rb', line 25

def value
  PryCommand.always_run == 1
end

#value=(val) ⇒ Object



21
22
23
# File 'lib/byebug/settings/autopry.rb', line 21

def value=(val)
  PryCommand.always_run = val ? 1 : 0
end