class Remind101::Client

Attributes

options[R]

Public Class Methods

authenticate!(username, password, *args) click to toggle source

Public: Helper remind Client#authenticate!

# File lib/remind101/client.rb, line 22
def self.authenticate!(username, password, *args)
  new(*args).authenticate!(username, password)
end
new(options = {}) { |middleware| ... } click to toggle source
# File lib/remind101/client.rb, line 34
def initialize(options = {})
  @options = options
  yield middleware if block_given?
end

Public Instance Methods

auth_token() click to toggle source

Public: Returns the auth token that’s being used for authenticated requests.

Returns String.

# File lib/remind101/client.rb, line 42
def auth_token
  options[:auth_token]
end
auth_token=(token) click to toggle source

Public: Sets the auth token to be used for authenticated requests.

Returns nothing.

# File lib/remind101/client.rb, line 49
def auth_token=(token)
  options[:auth_token] = token
end
authenticate!(username, password) click to toggle source

Public: Authenticates using this client, then returns a new client with the access token.

Returns a Remind101::Client.

# File lib/remind101/client.rb, line 29
def authenticate!(username, password)
  resp = post_access_tokens(user: { email: username, password: password })
  self.class.new(options.merge(auth_token: resp.body.token))
end