Sha256: 5bb022cf7cf3d5d625ee8c9fdab81f222d9aac78f2be80909f495347dd6381e1

Contents?: true

Size: 654 Bytes

Versions: 3

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

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

        def each(&block)
          actions.each(&block)
        end

        protected

        def load_resource(options)
          request.get("/actions", options)
        end

        private

        def actions
          @actions ||= begin
            actions = []

            if data
              data.each do |action|
                actions << Kentaa::Api::Resources::Action.new(config, data: action)
              end
            end

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