class Litmus::Instant::Client

This allows us to create API Client instances, useful primarily with OAuth, to set a token for each authorized user in a thread safe manner All the class methods on `Instant` are made available on the instance

Public Class Methods

new(oauth_token: nil, api_key: nil) click to toggle source
# File lib/litmus/instant.rb, line 55
def new(oauth_token: nil, api_key: nil)
  Class.new(Instant) do |klass|
    extend Forwardable

    def_delegators(
      :"self.class",
      *(Litmus::Instant.methods - Object.methods)
    )

    klass.oauth_token = oauth_token if oauth_token
    klass.api_key = api_key if api_key
  end.new
end