Class: ProductionBreakpoints::Configuration
- Inherits:
-
Object
- Object
- ProductionBreakpoints::Configuration
- Defined in:
- lib/ruby-production-breakpoints/configuration.rb
Defined Under Namespace
Modules: Modes
Instance Attribute Summary collapse
-
#configured_breakpoints ⇒ Object
readonly
Returns the value of attribute configured_breakpoints.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#path ⇒ Object
Returns the value of attribute path.
-
#signal ⇒ Object
readonly
Returns the value of attribute signal.
Instance Method Summary collapse
- #finish! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new configuration instance.
Constructor Details
#initialize ⇒ Configuration
A new configuration instance
22 23 24 25 26 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 22 def initialize @mode = Modes::SIGNAL @signal = Modes::SIGNALS::SIGURG @logger = Logger.new(STDERR) end |
Instance Attribute Details
#configured_breakpoints ⇒ Object (readonly)
Returns the value of attribute configured_breakpoints.
18 19 20 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 18 def configured_breakpoints @configured_breakpoints end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
18 19 20 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 18 def logger @logger end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
18 19 20 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 18 def mode @mode end |
#path ⇒ Object
Returns the value of attribute path.
19 20 21 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 19 def path @path end |
#signal ⇒ Object (readonly)
Returns the value of attribute signal.
18 19 20 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 18 def signal @signal end |
Instance Method Details
#finish! ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ruby-production-breakpoints/configuration.rb', line 28 def finish! enable_trap if File.exist?(path) @configured_breakpoints = JSON.load(File.read(path)) else logger.error("Config file #{path} not found") end end |