Class: Tagstand::User

Inherits:
Object
  • Object
show all
Defined in:
lib/tagstand/user.rb

Overview

Represents a user

Class Method Summary collapse

Class Method Details

.create(email, pwd = nil) ⇒ Object

TODO: document this method TODO: POST body causing error



11
12
13
14
15
16
17
18
# File 'lib/tagstand/user.rb', line 11

def create(email, pwd=nil)
  options = {query: {api_key: Tagstand.api_key}}
  user = {email: email}
  user.merge!(password: pwd) if pwd
  options.merge!(body: "user=#{user.to_json}")
  response = Tagstand.post "/user_create", options
  Hashie::Mash.new(response)
end

.key(email, pwd) ⇒ Object

TODO: document this method



21
22
23
24
25
# File 'lib/tagstand/user.rb', line 21

def key(email, pwd)
  options = {query: {api_key: Tagstand.api_key, email: email, password: pwd}}
  response = Tagstand.get "/user_key", options
  Hashie::Mash.new(response)
end