class ExposeDB::App

Attributes

db[R]

Public Class Methods

run!(sequel_db, *args) click to toggle source
Calls superclass method
# File lib/expose_db/app.rb, line 8
def run!(sequel_db, *args)
  @db = sequel_db
  super(*args)
end

Public Instance Methods

db() click to toggle source
# File lib/expose_db/app.rb, line 23
def db
  self.class.db
end
ensure_table_exists!() click to toggle source
# File lib/expose_db/app.rb, line 27
def ensure_table_exists!
  raise Sinatra::NotFound unless db.table_exists?(table_name)
end
expose(obj) click to toggle source
# File lib/expose_db/app.rb, line 35
def expose(obj)
  MultiJson.dump obj
end
table_name() click to toggle source
# File lib/expose_db/app.rb, line 31
def table_name
  @table_name ||= params[:table].to_sym
end