Class: Tiltify::TeamsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/tiltify/resources/teams.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Tiltify::Resource

Instance Method Details

#campaigns(team_id:) ⇒ Object



8
9
10
11
# File 'lib/tiltify/resources/teams.rb', line 8

def campaigns(team_id:)
  response = get_request("teams/#{team_id}/campaigns")
  Collection.from_response(response, type: Campaign)
end

#retrieve(team_id:) ⇒ Object



4
5
6
# File 'lib/tiltify/resources/teams.rb', line 4

def retrieve(team_id:)
  Team.new get_request("teams/#{team_id}").body.dig("data")
end