Class: Sinatra::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/jotify/api.rb

Constant Summary collapse

Lock =
Mutex.new

Instance Method Summary collapse

Instance Method Details

#error(code, message) ⇒ Object



20
21
22
# File 'lib/jotify/api.rb', line 20

def error(code, message)
  [code, { 'status' => 'ERROR', 'message' => message }.to_json]
end

#jotifyObject



10
11
12
13
14
# File 'lib/jotify/api.rb', line 10

def jotify
  Lock.synchronize do
    @@jotify ||= Jotify.new
  end
end

#query(what, p = what) ⇒ Object



16
17
18
# File 'lib/jotify/api.rb', line 16

def query(what, p=what) 
  params[p] ? "#{what}:" + params[p] : '' 
end