class TelegramWorkflow::Stores::File

Constants

StorePath

Public Class Methods

new() click to toggle source
# File lib/telegram_workflow/stores/file.rb, line 6
def initialize
  StorePath.dirname.mkpath unless StorePath.exist?
  @store = DBM.open(StorePath.to_s)
end

Public Instance Methods

read(key) click to toggle source
# File lib/telegram_workflow/stores/file.rb, line 11
def read(key)
  @store[key.to_s]
end
write(key, value) click to toggle source
# File lib/telegram_workflow/stores/file.rb, line 15
def write(key, value)
  @store[key.to_s] = value
end