class Api::Client

Client for an API

Constants

CONVENIENCE_HEADERS

Header keys that can be passed in options hash to {#get}

Public Class Methods

new(options = {}) click to toggle source
# File lib/api/client.rb, line 17
def initialize(options = {})
  reset!(options)
end

Public Instance Methods

inspect() click to toggle source

Text representation of the client, masking tokens and passwords

@return [String]

Calls superclass method
# File lib/api/client.rb, line 24
def inspect
  inspected = super

  # mask password
  inspected = inspected.gsub! @basic_password, "*******" if @basic_password
  # Only show last 4 of token, secret
  if @access_token
    inspected = inspected.gsub! @access_token, "#{'*'*36}#{@access_token[36..-1]}"
  end

  inspected
end