class RFlow::Configuration::Setting
Represents a setting in the SQLite database.
Constants
- DEFAULTS
Default settings.
- DIRECTORY_PATHS
- FILE_PATHS
Public Class Methods
[](name)
click to toggle source
Look up a {Setting} by name from the SQLite database. @return [Setting]
# File lib/rflow/configuration/setting.rb, line 61 def self.[](name) Setting.find(name).value rescue nil end
Private Instance Methods
directory_path?()
click to toggle source
TODO: Think about making this a regex check to pull in other, externally-defined settings
# File lib/rflow/configuration/setting.rb, line 42 def directory_path? DIRECTORY_PATHS.include? self.name end
valid_directory_path?()
click to toggle source
# File lib/rflow/configuration/setting.rb, line 46 def valid_directory_path? unless File.directory? self.value errors.add :value, "setting '#{self.name}' is not a directory ('#{File.expand_path self.value}')" end end
valid_writable_path?()
click to toggle source
# File lib/rflow/configuration/setting.rb, line 52 def valid_writable_path? unless File.writable? self.value errors.add :value, "setting '#{self.name}' is not writable ('#{File.expand_path self.value}')" end end