Class: Bogy::FileHandler
- Includes:
- Writeable
- Defined in:
- lib/bogy/file_handler.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ FileHandler
constructor
A new instance of FileHandler.
- #load ⇒ Object
- #write ⇒ Object
Methods inherited from Handler
Constructor Details
#initialize(path) ⇒ FileHandler
Returns a new instance of FileHandler.
5 6 7 |
# File 'lib/bogy/file_handler.rb', line 5 def initialize(path) @path = path end |
Instance Method Details
#load ⇒ Object
9 10 11 |
# File 'lib/bogy/file_handler.rb', line 9 def load YAML.load_file(@path) end |
#write ⇒ Object
13 14 15 |
# File 'lib/bogy/file_handler.rb', line 13 def write IO.write(@path, hash.to_yaml) end |