lib/kentaa/api/resources/teams.rb in kentaa-api-0.2.1 vs lib/kentaa/api/resources/teams.rb in kentaa-api-0.3.0

- old
+ new

@@ -1,26 +1,31 @@ # frozen_string_literal: true module Kentaa module Api module Resources - class Teams < Base + class Teams < List include Enumerable - include Kentaa::Api::Resources::Pagination def each(&block) teams.each(&block) end + protected + + def load_resource(options) + request.get("/teams", options) + end + private def teams @teams ||= begin teams = [] if data data.each do |team| - teams << Kentaa::Api::Resources::Team.new(config, team) + teams << Kentaa::Api::Resources::Team.new(config, data: team) end end teams end