lib/kentaa/api/resources/projects.rb in kentaa-api-0.2.1 vs lib/kentaa/api/resources/projects.rb in kentaa-api-0.3.0
- old
+ new
@@ -1,26 +1,31 @@
# frozen_string_literal: true
module Kentaa
module Api
module Resources
- class Projects < Base
+ class Projects < List
include Enumerable
- include Kentaa::Api::Resources::Pagination
def each(&block)
projects.each(&block)
end
+ protected
+
+ def load_resource(options)
+ request.get("/projects", options)
+ end
+
private
def projects
@projects ||= begin
projects = []
if data
data.each do |project|
- projects << Kentaa::Api::Resources::Project.new(config, project)
+ projects << Kentaa::Api::Resources::Project.new(config, data: project)
end
end
projects
end