Class: Configuration

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

Overview

Configuration class for the application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
# File 'worklog/configuration.rb', line 9

def initialize(&block)
  block.call(self) if block_given?

  # Set default values if not set
  @storage_path ||= File.join(Dir.home, '.worklog')
  @log_level ||= :info
  @webserver_port ||= 3000
end

Instance Attribute Details

#log_levelObject

Returns the value of attribute log_level.



7
8
9
# File 'worklog/configuration.rb', line 7

def log_level
  @log_level
end

#storage_pathObject

Returns the value of attribute storage_path.



7
8
9
# File 'worklog/configuration.rb', line 7

def storage_path
  @storage_path
end

#webserver_portObject

Returns the value of attribute webserver_port.



7
8
9
# File 'worklog/configuration.rb', line 7

def webserver_port
  @webserver_port
end