Class: Sinatra::Application
- Inherits:
-
Object
- Object
- Sinatra::Application
- 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, ) [code, { 'status' => 'ERROR', 'message' => }.to_json] end |
#jotify ⇒ Object
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 |