Class: Ruku::YAMLStorage

Inherits:
Storage show all
Defined in:
lib/ruku/storage.rb

Overview

Stores Roku box information on disk in YAML

Constant Summary

Constants inherited from Storage

Storage::FILE_NAME

Instance Attribute Summary

Attributes inherited from Storage

#storage_path

Instance Method Summary collapse

Methods inherited from Storage

#initialize

Constructor Details

This class inherits a constructor from Ruku::Storage

Instance Method Details

#loadObject



69
70
71
72
73
74
75
# File 'lib/ruku/storage.rb', line 69

def load
  if File.exist? @storage_path
    YAML.load_file(@storage_path)
  else
    Remotes.new
  end
end

#store(manager) ⇒ Object



63
64
65
66
67
# File 'lib/ruku/storage.rb', line 63

def store(manager)
  File.open(@storage_path, 'w') do |out|
    YAML.dump(manager, out)
  end
end