Sha256: e497819ba30d7e0646b857dab0c7ea58d65395856c15314e844b890e56dc746b

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

module Tumbz
  class User
    include Model
    include Her::Model
    uses_api Tumbz.api
    custom_get :search

    def self.sign_in!(email, password)
      post_raw("auth", :email => email, :password => password) do |parsed_data|
        Thread.current[:tumbz_access_token] = parsed_data[:data][:access_token]
      end
    end

    def self.set_access_token!(access_token)
      Thread.current[:tumbz_access_token] = access_token
    end

    def self.sign_out!
      Thread.current[:tumbz_access_token] = nil
      Thread.current[:tumbz_access_token].nil?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tumbz-0.0.5 lib/tumbz/user.rb