Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- worklog/configuration.rb
Overview
Configuration class for the application.
Instance Attribute Summary collapse
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#storage_path ⇒ Object
Returns the value of attribute storage_path.
-
#webserver_port ⇒ Object
Returns the value of attribute webserver_port.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Configuration
constructor
A new instance of Configuration.
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_level ⇒ Object
Returns the value of attribute log_level.
7 8 9 |
# File 'worklog/configuration.rb', line 7 def log_level @log_level end |
#storage_path ⇒ Object
Returns the value of attribute storage_path.
7 8 9 |
# File 'worklog/configuration.rb', line 7 def storage_path @storage_path end |
#webserver_port ⇒ Object
Returns the value of attribute webserver_port.
7 8 9 |
# File 'worklog/configuration.rb', line 7 def webserver_port @webserver_port end |