lib/kentaa/api/resources/team.rb in kentaa-api-0.3.2 vs lib/kentaa/api/resources/team.rb in kentaa-api-0.4.0

- old
+ new

@@ -115,11 +115,11 @@ @photos ||= begin photos = [] if data[:photos] data[:photos].each do |photo| - photos << Kentaa::Api::Resources::Photo.new(config, data: photo) + photos << Kentaa::Api::Resources::Photo.new(photo) end end photos end @@ -129,11 +129,11 @@ @videos ||= begin videos = [] if data[:videos] data[:videos].each do |video| - videos << Kentaa::Api::Resources::Video.new(config, data: video) + videos << Kentaa::Api::Resources::Video.new(video) end end videos end @@ -143,11 +143,11 @@ @questions ||= begin questions = [] if data[:questions] data[:questions].each do |question| - questions << Kentaa::Api::Resources::Question.new(config, data: question) + questions << Kentaa::Api::Resources::Question.new(question) end end questions end @@ -155,12 +155,20 @@ def external_reference data[:external_reference] end - protected + def donations + @donations ||= Kentaa::Api::Resources::Donations.new(config, team_id: id) + end - def load_resource(options) + def manual_donations + @manual_donations ||= Kentaa::Api::Resources::ManualDonations.new(config, team_id: id) + end + + private + + def load_resource request.get("/teams/#{id}", options) end end end end