Class: App::Cache::SqliteStore

Inherits:
MicroSql::KeyValueTable
  • Object
show all
Defined in:
lib/app/app/cache.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSqliteStore

Returns a new instance of SqliteStore.



19
20
21
22
# File 'lib/app/app/cache.rb', line 19

def initialize
  @db = MicroSql.create(SqliteStore.db_path)
  super @db, "cache"
end

Class Method Details

.db_pathObject



11
12
13
14
15
16
17
# File 'lib/app/app/cache.rb', line 11

def self.db_path
  @db_path ||= begin
    path = "#{Dir.home}/cache/#{File.basename(App.root)}/a#{App.root.uid64}.sqlite3"
    FileUtils.mkdir_p File.dirname(path)
    path
  end
end