Sha256: 845025c5dd12e8650a2ec4b47661e1f05c66bf83719360aae6d7cbe2a92e0c1a

Contents?: true

Size: 769 Bytes

Versions: 7

Compression:

Stored size: 769 Bytes

Contents

require 'httparty'

module FlightPlanCli
  class Api

    def initialize(url:, key:, secret:, board_id: nil, repo_id: nil)
      @url = url
      @key = key
      @secret = secret
      @board_id = board_id
      @repo_id = repo_id
    end

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

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

    private

    attr_reader :url, :key, :secret
    attr_reader :board_id, :repo_id

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flight_plan_cli-0.3.4 lib/flight_plan_cli/api.rb
flight_plan_cli-0.3.3 lib/flight_plan_cli/api.rb
flight_plan_cli-0.3.2 lib/flight_plan_cli/api.rb
flight_plan_cli-0.3.1 lib/flight_plan_cli/api.rb
flight_plan_cli-0.3.0 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.8 lib/flight_plan_cli/api.rb
flight_plan_cli-0.2.6 lib/flight_plan_cli/api.rb