Class: LND::Tool::Store::SQLiteBase

Inherits:
Object
  • Object
show all
Defined in:
lib/lnd/tool/store/sqlite_base.rb

Overview

Abstract class for store.

Direct Known Subclasses

HTLCEvent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = Daemon.db_path) ⇒ SQLiteBase

Initialize data store.

Parameters:

  • path (Pathname) (defaults to: Daemon.db_path)

    data base path.



13
14
15
16
# File 'lib/lnd/tool/store/sqlite_base.rb', line 13

def initialize(path = Daemon.db_path)
  @db = SQLite3::Database.new(path.to_s)
  setup
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



9
10
11
# File 'lib/lnd/tool/store/sqlite_base.rb', line 9

def db
  @db
end

Instance Method Details

#setupObject

Raises:



18
19
20
# File 'lib/lnd/tool/store/sqlite_base.rb', line 18

def setup
  raise Error, 'Inherit and implement the setup method.'
end