Class: Bushido::User
- Inherits:
-
Object
- Object
- Bushido::User
- Defined in:
- lib/bushido/user.rb
Overview
Bushido User enables user validation against Bushido’s server
Class Method Summary collapse
-
.exists?(email) ⇒ Boolean
Checks whether email corresponds to a valid Bushido user.
-
.unity_url ⇒ Object
:nodoc:.
-
.valid?(email, pass) ⇒ Boolean
Checks whether user an email and password correspond to a valid bushido user.
Class Method Details
.exists?(email) ⇒ Boolean
Checks whether email corresponds to a valid Bushido user. Returns true or false
22 23 24 25 26 |
# File 'lib/bushido/user.rb', line 22 def exists?(email) params = {} params[:email] = email Bushido::Command.post_command("#{unity_url}/exists", params) end |
.unity_url ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/bushido/user.rb', line 5 def unity_url #:nodoc: "#{Bushido::Platform.host}/unity/v1" end |
.valid?(email, pass) ⇒ Boolean
Checks whether user an email and password correspond to a valid bushido user. Returns nil if false, or the Bushido user’s ID if true.
12 13 14 15 16 17 |
# File 'lib/bushido/user.rb', line 12 def valid?(email, pass) params = {} params[:email] = email params[:pass] = pass Bushido::Command.post_command("#{unity_url}/valid", params) end |