Class: Hexlet::BaseClient
- Inherits:
-
Object
- Object
- Hexlet::BaseClient
- Defined in:
- lib/hexlet/base_client.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(key, options = {}) ⇒ BaseClient
constructor
A new instance of BaseClient.
- #login ⇒ Object
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, ={}) @key = key @host = [:host] || "http://hexlet.io" @logger = [:logger] @router = Router.new @host end |
Instance Method Details
#login ⇒ Object
10 11 12 13 14 15 16 17 18 |
# 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 |