Class: GtkApp::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk_app/config.rb

Constant Summary collapse

PATH =
"#{ENV['HOME']}/.gtk_app"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Config

Returns a new instance of Config.



9
10
11
# File 'lib/gtk_app/config.rb', line 9

def initialize(name)
  Dir.mkdir(PATH) unless Dir.exist?(PATH)
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



5
6
7
# File 'lib/gtk_app/config.rb', line 5

def file
  @file
end

#hashObject (readonly)

Returns the value of attribute hash.



5
6
7
# File 'lib/gtk_app/config.rb', line 5

def hash
  @hash
end

Instance Method Details

#saveObject



13
14
15
16
# File 'lib/gtk_app/config.rb', line 13

def save
  # File.open(@file, 'w') { |fp| fp.write(@hash.to_json) }
  
end