Class: Sup::Api::User

Inherits:
Base show all
Defined in:
lib/sup/api.rb

Class Method Summary collapse

Class Method Details

.check_name(name) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/sup/api.rb', line 46

def self.check_name(name)
  begin
    get :check_name, :name => name
  rescue ActiveResource::ResourceNotFound
    false
  end
end

.get_api_key(email, password) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/sup/api.rb', line 35

def self.get_api_key(email,password)
  project_config = Yamlize.new(File.join(Dir.pwd, PROJECT_CONFIG_PATH)) rescue {}
  Base.site = project_config['domain'] || API_URL
  
  begin
    post(:get_api_key, :email => email, :password => password).body
  rescue ActiveResource::ResourceNotFound
    false
  end
end