Class: FactoryTrace::Configuration
- Inherits:
-
Object
- Object
- FactoryTrace::Configuration
- Defined in:
- lib/factory_trace/configuration.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#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
5 6 7 8 9 |
# 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'] @color = path.nil? end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
3 4 5 |
# File 'lib/factory_trace/configuration.rb', line 3 def color @color end |
#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
11 12 13 14 15 |
# File 'lib/factory_trace/configuration.rb', line 11 def out return STDOUT unless path File.open(path, 'w') end |