Sha256: 1f845986f024343a6c098321a144f1b15be6db4c56cc63de0f7fc132c1a05c41

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

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

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

            projects
          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/projects.rb
kentaa-api-0.3.1 lib/kentaa/api/resources/projects.rb
kentaa-api-0.3.0 lib/kentaa/api/resources/projects.rb