class Bogy::FileHandler

Public Class Methods

new(path) click to toggle source
# File lib/bogy/handlers/file_handler.rb, line 6
def initialize(path)
  raise ArgumentError, "value should be of String type, not #{path.class}" unless path.is_a? String
  raise IOError, "No such file - #{path}" unless File.exist?(path)

  @path = path
end

Public Instance Methods

load() click to toggle source
# File lib/bogy/handlers/file_handler.rb, line 13
def load
  YAML.load_file(@path)
end
write() click to toggle source
# File lib/bogy/handlers/file_handler.rb, line 17
def write
  IO.write(@path, hash.to_yaml)
end