Class: Scriptster::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/scriptster/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

Parameters:

  • the value to set the attribute file to.



28
29
30
# File 'lib/scriptster/configuration.rb', line 28

def file=(value)
  @file = value
end

#name=(value) ⇒ Object (writeonly)

Sets the attribute name

Parameters:

  • the value to set the attribute name to.



28
29
30
# File 'lib/scriptster/configuration.rb', line 28

def name=(value)
  @name = value
end

#scheme=(value) ⇒ Object (writeonly)

Sets the attribute scheme

Parameters:

  • the value to set the attribute scheme to.



28
29
30
# File 'lib/scriptster/configuration.rb', line 28

def scheme=(value)
  @scheme = value
end

#timestamps=(value) ⇒ Object (writeonly)

Sets the attribute timestamps

Parameters:

  • the value to set the attribute timestamps to.



28
29
30
# File 'lib/scriptster/configuration.rb', line 28

def timestamps=(value)
  @timestamps = value
end

#verbosity=(value) ⇒ Object (writeonly)

Sets the attribute verbosity

Parameters:

  • the value to set the attribute verbosity to.



28
29
30
# File 'lib/scriptster/configuration.rb', line 28

def verbosity=(value)
  @verbosity = value
end

Instance Method Details

#applyObject

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.show_timestamps if @timestamps

  ColourSchemes.send @scheme
end