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

- old
+ new

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