class Glima::Context

Public Class Methods

new(basedir) click to toggle source
# File lib/glima/context.rb, line 7
def initialize(basedir)
  unless basedir and File.directory?(File.expand_path(basedir.to_s))
    raise Glima::ConfigurationError, "datastore directory '#{basedir}' not found"
  end
  @basedir = Pathname.new(File.expand_path(basedir))
end

Public Instance Methods

load_page_token() click to toggle source
# File lib/glima/context.rb, line 20
def load_page_token
  File.open(page_token_path).read.to_s
end
save_page_token(token) click to toggle source
# File lib/glima/context.rb, line 14
def save_page_token(token)
  File.open(page_token_path, "w") do |f|
    f.write(token)
  end
end

Private Instance Methods

page_token_path() click to toggle source
# File lib/glima/context.rb, line 27
def page_token_path
  File.expand_path("page_token.context", @basedir)
end