Sha256: 7d82a69030241f39e1f94744462c4d38bb31133b3e47fd07eef5a3069a492881

Contents?: true

Size: 665 Bytes

Versions: 10

Compression:

Stored size: 665 Bytes

Contents

require 'httparty'

module FlightPlanCli
  class Api
    def initialize(url:, key:, secret:)
      @url = url
      @key = key
      @secret = secret
    end

    def board_tickets(board_id: nil, repo_id: nil, repo_url: nil, assignee_username: nil)
      params = {
        board_id: board_id,
        repo_id: repo_id,
        repo_url: repo_url,
        assignee_username: assignee_username
      }

      HTTParty.get("#{url}/board_tickets.json", query: params, headers: headers)
    end

    private

    attr_reader :url, :key, :secret

    def headers
      @headers = {
        'Authorization' => "Token token=\"#{key}:#{secret}\""
      }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flight_plan_cli-0.2.5 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.4 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.3 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.2 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.1 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.0 lib/flight_plan_cli/api.rb
flight_plan_cli-0.1.0 lib/flight_plan_cli/api.rb
flight_plan_cli-0.0.6 lib/flight_plan_cli/api.rb
flight_plan_cli-0.0.5 lib/flight_plan_cli/api.rb
flight_plan_cli-0.0.4 lib/flight_plan_cli/api.rb