Sha256: 36836b1ce760420e8a0b62ef3448c43c3028f96e963e75cba2a7bed6643d4da7

Contents?: true

Size: 797 Bytes

Versions: 5

Compression:

Stored size: 797 Bytes

Contents

require 'learn_web/client/user'
require 'learn_web/client/pull_request'
require 'learn_web/client/lesson'
require 'learn_web/client/validate_repo'
require 'learn_web/client/fork'

module LearnWeb
  class Client
    attr_reader :token, :conn, :silent_output

    LEARN_URL = 'https://learn.co'
    API_ROOT  = '/api/v1'

    include LearnWeb::Client::PullRequest
    include LearnWeb::Client::Lesson
    include LearnWeb::Client::ValidateRepo
    include LearnWeb::Client::Fork
    include LearnWeb::Client::User

    def initialize(token:, silent_output: false)
      @token = token
      @silent_output = silent_output
      @conn = Faraday.new(url: LEARN_URL) do |faraday|
        faraday.adapter Faraday.default_adapter
      end
    end

    def valid_token?
      !!me.data
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
learn-web-1.0.4 lib/learn_web/client.rb
learn-web-1.0.3 lib/learn_web/client.rb
learn-web-1.0.2 lib/learn_web/client.rb
learn-web-1.0.1 lib/learn_web/client.rb
learn-web-1.0.0 lib/learn_web/client.rb