Class: FactoryTrace::Configuration
- Inherits:
-
Object
- Object
- FactoryTrace::Configuration
- Defined in:
- lib/factory_trace/configuration.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #out ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 |
# File 'lib/factory_trace/configuration.rb', line 5 def initialize @enabled = ENV.key?('FB_TRACE') || ENV.key?('FB_TRACE_FILE') @path = ENV['FB_TRACE_FILE'] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/factory_trace/configuration.rb', line 3 def enabled @enabled end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/factory_trace/configuration.rb', line 3 def path @path end |
Instance Method Details
#out ⇒ Object
10 11 12 13 14 |
# File 'lib/factory_trace/configuration.rb', line 10 def out return STDOUT unless path File.open(path, 'w') end |