Class: GtkApp::Config
- Inherits:
-
Object
- Object
- GtkApp::Config
- Defined in:
- lib/gtk_app/config.rb
Constant Summary collapse
- PATH =
"#{ENV['HOME']}/.gtk_app"
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(name) ⇒ Config
constructor
A new instance of Config.
- #save ⇒ Object
Constructor Details
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/gtk_app/config.rb', line 5 def file @file end |
#hash ⇒ Object (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
#save ⇒ Object
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 |