class Hexlet::BaseClient

Public Class Methods

new(key, options={}) click to toggle source
# File lib/hexlet/base_client.rb, line 3
def initialize(key, options={})
  @key = key
  @host = options[:host] || "http://hexlet.io"
  @logger = options[:logger]
  @router = Router.new @host
end

Public Instance Methods

login() click to toggle source
# File lib/hexlet/base_client.rb, line 10
def login
  url = @router.api_member_user_check_url
  @logger.debug url

  RestClient.get url, headers do |response, request, result, &block|
    @logger.debug response
    200 == response.code
  end
end

Private Instance Methods

headers(other = {}) click to toggle source
# File lib/hexlet/base_client.rb, line 22
def headers(other = {})
  {"X-Hexlet-Api-Key" => @key}.merge other
end