Class: Papago::Application
- Inherits:
-
Object
- Object
- Papago::Application
- Defined in:
- lib/papago.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/papago.rb', line 20 def initialize @config = TTY::Config.new @config_dir = File.dirname(config_file) unless File.exist?(@config_dir) FileUtils.mkdir(@config_dir) end @config.append_path @config_dir if File.exist?(config_file) @config.read else @config.write end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
18 19 20 |
# File 'lib/papago.rb', line 18 def config @config end |