Class: Cloudfuji::User

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

Overview

Cloudfuji User enables user validation against Cloudfuji’s server

Class Method Summary collapse

Methods inherited from Base

notify_user_url

Class Method Details

.exists?(email) ⇒ Boolean

Checks whether email corresponds to a valid Cloudfuji user. Returns true or false

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/cloudfuji/user.rb', line 17

def exists?(email)
  params = {}
  params[:email] = email
  Cloudfuji::Command.post_command(exists_unity_url, params)
end

.invite(email) ⇒ Object

send a Cloudfuji invite with a short description of the app (also a box of chocolates, if he’s a Kryptonian) Cloudfuji::User.invite(“[email protected]”)



25
26
27
28
29
# File 'lib/cloudfuji/user.rb', line 25

def invite(email)
  params = {}
  params[:email] = email
  Cloudfuji::Command.post_command(invite_unity_url, params)
end

.notify(ido_id, title, body, category = "general") ⇒ Object

To send a notification to a user who belongs to your app Cloudfuji::User.notify(‘5z325f4knbm2f’, ‘Example title’, ‘Example message’, ‘chat’)



48
49
50
51
52
53
54
55
56
# File 'lib/cloudfuji/user.rb', line 48

def notify(ido_id, title, body, category="general")
  params            = {}
  params[:ido_id]   = ido_id
  params[:title]    = title
  params[:body]     = body
  params[:category] = category

  Cloudfuji::Command.post_command(notify_user_url, params)
end

.pending_invitesObject

List all pending invites Cloudfuji::User.pending_invites



33
34
35
36
# File 'lib/cloudfuji/user.rb', line 33

def pending_invites
  params = {}
  Cloudfuji::Command.get_command(pending_invites_unity_url, params)
end

.remove(ido_id) ⇒ Object

To remove a user from an application Cloudfuji::User.remove(“5z325f4knbm2f”)



40
41
42
43
44
# File 'lib/cloudfuji/user.rb', line 40

def remove(ido_id)
    params = {}
    params[:ido_id] = ido_id
    Cloudfuji::Command.post_command(remove_unity_url, params)
end

.valid?(email, pass) ⇒ Boolean

Checks whether user an email and password correspond to a valid cloudfuji user. Returns nil if false, or the Cloudfuji user’s ID if true.

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/cloudfuji/user.rb', line 8

def valid?(email, pass)
  params = {}
  params[:email] = email
  params[:pass] = pass
  Cloudfuji::Command.post_command(valid_unity_url, params)
end