Class: CC::CLI::FileStore
- Inherits:
-
Object
- Object
- CC::CLI::FileStore
- Defined in:
- lib/cc/cli/file_store.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ FileStore
constructor
This class is not supposed to be directly used.
- #save ⇒ Object
Constructor Details
#initialize ⇒ FileStore
This class is not supposed to be directly used. It should be sublcassed and a few constants need to be defined on the sublass to be usable.
FILE_NAME is the name of the file this class wraps.
12 13 14 |
# File 'lib/cc/cli/file_store.rb', line 12 def initialize load_data end |
Instance Method Details
#save ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/cc/cli/file_store.rb', line 16 def save return false unless File.exist? self.class::FILE_NAME File.open(self.class::FILE_NAME, "w") do |f| YAML.dump data, f end true end |