Class: YumRepo::Settings
Instance Attribute Summary collapse
-
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
-
#cache_expire ⇒ Object
Returns the value of attribute cache_expire.
-
#cache_path ⇒ Object
Returns the value of attribute cache_path.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
- #log ⇒ Object
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
32 33 34 35 36 37 38 39 |
# File 'lib/yumrepo.rb', line 32 def initialize @cache_path = "#{ENV['HOME']}/.yumrepo/cache/" # Cache expire in seconds @cache_expire = 3600 @cache_enabled = true @initialized = false @log_level = :info end |
Instance Attribute Details
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
30 31 32 |
# File 'lib/yumrepo.rb', line 30 def cache_enabled @cache_enabled end |
#cache_expire ⇒ Object
Returns the value of attribute cache_expire.
30 31 32 |
# File 'lib/yumrepo.rb', line 30 def cache_expire @cache_expire end |
#cache_path ⇒ Object
Returns the value of attribute cache_path.
30 31 32 |
# File 'lib/yumrepo.rb', line 30 def cache_path @cache_path end |
#log_level ⇒ Object
Returns the value of attribute log_level.
30 31 32 |
# File 'lib/yumrepo.rb', line 30 def log_level @log_level end |
Instance Method Details
#init ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/yumrepo.rb', line 63 def init if @initialized log.debug "Settings already initialized" return end log.debug "Initializing settings" @initialized = true end |
#log ⇒ Object
59 60 61 |
# File 'lib/yumrepo.rb', line 59 def log @log ||= Logger.new($stdout) end |