Sha256: bf04f50ff3a43bcfe138048fa012e2c208ebe5a98bec77fcb6b8b3d11b6655a9

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

module Kentaa
  module Api
    module Resources
      class Users < List
        include Enumerable

        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, data: user)
              end
            end

            users
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kentaa-api-0.3.2 lib/kentaa/api/resources/users.rb
kentaa-api-0.3.1 lib/kentaa/api/resources/users.rb
kentaa-api-0.3.0 lib/kentaa/api/resources/users.rb