Class: Danger::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/favro/api_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_name, api_token, organization_id) ⇒ ApiClient

Returns a new instance of ApiClient.


5
6
7
8
9
# File 'lib/favro/api_client.rb', line 5

def initialize(user_name, api_token, organization_id)
  @user_name = user_name
  @api_token = api_token
  @organization_id = organization_id
end

Instance Method Details

#get(card_ids) ⇒ Object


11
12
13
14
15
16
17
18
# File 'lib/favro/api_client.rb', line 11

def get(card_ids)
  cards = []
  card_ids.each do |id|
    response = request(id)
    cards << Card.new(id, response.nil? ? "<i>(unknown)</i>" : response["entities"][0]["name"])
  end
  cards
end