Class: Macdiff::App
- Inherits:
-
Object
- Object
- Macdiff::App
- Defined in:
- lib/macdiff/app.rb
Overview
Handle the global access such as configuration
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
10 11 12 13 14 15 16 17 18 |
# File 'lib/macdiff/app.rb', line 10 def initialize @config = TTY::Config.new @config.filename = 'macdiff' @config.extname = '.yml' # @config.append_path Dir.pwd # Dir.home @config.append_path File.join(Dir.home, '.config') @config.write unless @config.exist? @config.read end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/macdiff/app.rb', line 8 def config @config end |
Class Method Details
.config ⇒ Object
20 21 22 |
# File 'lib/macdiff/app.rb', line 20 def self.config @config ||= new.config end |