Sha256: 2e3695bbe8d1386c32adc62eca92218f995a5faeaf4156af824aa5653c9b64f2

Contents?: true

Size: 813 Bytes

Versions: 13

Compression:

Stored size: 813 Bytes

Contents

module Bushido
  # Bushido User enables user validation against Bushido's server
  class User
    class << self
      def unity_url #:nodoc:
        "#{Bushido::Platform.host}/unity/v1"
      end


      # 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.
      def valid?(email, pass)
        params = {}
        params[:email] = email
        params[:pass] = pass
        Bushido::Command.post_command("#{unity_url}/valid", params)
      end
      

      # Checks whether email corresponds to a valid Bushido user.
      # Returns true or false
      def exists?(email)
        params = {}
        params[:email] = email
        Bushido::Command.post_command("#{unity_url}/exists", params)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bushido-0.0.35 lib/bushido/user.rb
bushido-0.0.34 lib/bushido/user.rb
bushido-0.0.33 lib/bushido/user.rb
bushido-0.0.32 lib/bushido/user.rb
bushido-0.0.31 lib/bushido/user.rb
bushido-0.0.30 lib/bushido/user.rb
bushido-0.0.29 lib/bushido/user.rb
bushido-0.0.28 lib/bushido/user.rb
bushido-0.0.27 lib/bushido/user.rb
bushido-0.0.26 lib/bushido/user.rb
bushido-0.0.25 lib/bushido/user.rb
bushido-0.0.21 lib/bushido/user.rb
bushido-0.0.20 lib/bushido/user.rb