Class: App

Inherits:
CouchRest::Model
  • Object
show all
Defined in:
lib/kernul/app.rb

Class Method Summary collapse

Class Method Details

.authenticate(symbol, key) ⇒ Object

Authenticates an application using its symbol and key



11
12
13
14
15
# File 'lib/kernul/app.rb', line 11

def self.authenticate(symbol, key)
  app = self.find_by_symbol(symbol)
  return app if app and app.key == key
  return false
end

.find_by_symbol(symbol) ⇒ Object

Shortcut to finding an application by its symbol



6
7
8
# File 'lib/kernul/app.rb', line 6

def self.find_by_symbol(symbol)
	by_symbol(:key => symbol)[0]
end