Class: Hexlet::BaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/hexlet/base_client.rb

Direct Known Subclasses

MemberClient, TeacherClient

Instance Method Summary collapse

Constructor Details

#initialize(key, options = {}) ⇒ BaseClient

Returns a new instance of BaseClient.



3
4
5
6
7
8
# 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

Instance Method Details

#loginObject



10
11
12
13
14
15
16
17
18
# File 'lib/hexlet/base_client.rb', line 10

def 
  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