Class: Scriptster::Configuration
- Inherits:
-
Object
- Object
- Scriptster::Configuration
- Defined in:
- lib/scriptster/configuration.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
writeonly
Sets the attribute file.
-
#name ⇒ Object
writeonly
Sets the attribute name.
-
#scheme ⇒ Object
writeonly
Sets the attribute scheme.
-
#timestamps ⇒ Object
writeonly
Sets the attribute timestamps.
-
#verbosity ⇒ Object
writeonly
Sets the attribute verbosity.
Instance Method Summary collapse
-
#apply ⇒ Object
Put the settings from this object in effect.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
30 31 32 33 34 35 36 |
# File 'lib/scriptster/configuration.rb', line 30 def initialize @name = File.basename($0) @verbosity = :verbose @file = nil @timestamps = true @scheme = :dark end |
Instance Attribute Details
#file=(value) ⇒ Object (writeonly)
Sets the attribute file
28 29 30 |
# File 'lib/scriptster/configuration.rb', line 28 def file=(value) @file = value end |
#name=(value) ⇒ Object (writeonly)
Sets the attribute name
28 29 30 |
# File 'lib/scriptster/configuration.rb', line 28 def name=(value) @name = value end |
#scheme=(value) ⇒ Object (writeonly)
Sets the attribute scheme
28 29 30 |
# File 'lib/scriptster/configuration.rb', line 28 def scheme=(value) @scheme = value end |
#timestamps=(value) ⇒ Object (writeonly)
Sets the attribute timestamps
28 29 30 |
# File 'lib/scriptster/configuration.rb', line 28 def (value) @timestamps = value end |
#verbosity=(value) ⇒ Object (writeonly)
Sets the attribute verbosity
28 29 30 |
# File 'lib/scriptster/configuration.rb', line 28 def verbosity=(value) @verbosity = value end |
Instance Method Details
#apply ⇒ Object
Put the settings from this object in effect
39 40 41 42 43 44 45 46 |
# File 'lib/scriptster/configuration.rb', line 39 def apply Logger.set_name @name if @name Logger.set_verbosity @verbosity if @verbosity Logger.set_file @file if @file Logger. if @timestamps ColourSchemes.send @scheme end |