Sha256: 785a84c14367311416def85bba2cb27e600f5c9befb6968af9c9cf8a047dffe5

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

require "rest-client"

module Qiitakun
  class Qiita
    API_ENDPOINT = "https://qiita.com/api/v2"

    def initialize(qiita_token)
      @qiita_token = qiita_token
    end

    def items
      json = RestClient.get("#{API_ENDPOINT}/items", "Authorization" => "Bearer #{@qiita_token}", accept: :json).body
      JSON.parse(json, symbolize_names: true).map { |repository| repository[:title] }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qiitakun-0.1.0 lib/qiitakun/qiita.rb