Sha256: 8ba59290645c9ff8d0ccf3b57fca92949847695f160b957ef9222338585c54d1

Contents?: true

Size: 792 Bytes

Versions: 10

Compression:

Stored size: 792 Bytes

Contents

module Barong
  # General  barong API functions
  class API
    require 'json'
    require 'rest-client'
    def initialize(endpoint, app_id)
      @endpoint = endpoint
      @app_id = app_id
    end

    def log_in(email, password)
      response = RestClient.post("#{@endpoint}/sessions",
                                 {
                                  'email': email,
                                  'password': password,
                                  'application_id': @app_id,
                                  'expires_in': 60_000_000
                                 },
                                 {
                                     'content_type': 'application/x-www-form-urlencoded'
                                 })
      response.delete('"')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
SimBot-0.1.14 lib/barong.rb
SimBot-0.1.13 lib/barong.rb
SimBot-0.1.12 lib/barong.rb
SimBot-0.1.11 lib/barong.rb
SimBot-0.1.10 lib/barong.rb
SimBot-0.1.8 lib/barong.rb
SimBot-0.1.7 lib/barong.rb
SimBot-0.1.6 lib/barong.rb
SimBot-0.1.5 lib/barong.rb
SimBot-0.1.4 lib/barong.rb