Sha256: 0f98a7cbcf53e07d26cade9efd8e18a93628acacbf3e353a5205b13463a45e2e

Contents?: true

Size: 1.02 KB

Versions: 65

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'avm/data/rotate'
require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/fs/temp'

module Avm
  module Data
    class Performer
      acts_as_abstract(:cannot_perform_reason, :internal_perform)
      acts_as_immutable
      common_constructor :data_owner
      immutable_accessor :exclude, :include, type: :set

      # @return [Enumerable]
      def immutable_constructor_args
        [data_owner]
      end

      # @return [self]
      def perform
        raise "Cannot run: #{cannot_perform_reason}" unless performable?

        internal_perform

        self
      end

      # @return [Boolean]
      def performable?
        cannot_perform_reason.blank?
      end

      protected

      def include_excludes_arguments
        options = include_excludes_options
        options.any? ? [options] : []
      end

      def include_excludes_options
        r = {}
        r[:includes] = includes if includes.any?
        r[:excludes] = excludes if excludes.any?
        r
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 2 rubygems

Version Path
avm-0.94.1 lib/avm/data/performer.rb
eac_tools-0.98.0 sub/avm/lib/avm/data/performer.rb
avm-0.94.0 lib/avm/data/performer.rb
eac_tools-0.94.0 sub/avm/lib/avm/data/performer.rb
avm-0.93.0 lib/avm/data/performer.rb
eac_tools-0.92.0 sub/avm/lib/avm/data/performer.rb
avm-0.92.0 lib/avm/data/performer.rb
eac_tools-0.91.0 sub/avm/lib/avm/data/performer.rb
avm-0.90.1 lib/avm/data/performer.rb
eac_tools-0.87.1 sub/avm/lib/avm/data/performer.rb
avm-0.90.0 lib/avm/data/performer.rb
eac_tools-0.87.0 sub/avm/lib/avm/data/performer.rb
avm-0.89.0 lib/avm/data/performer.rb
eac_tools-0.86.12 sub/avm/lib/avm/data/performer.rb
avm-0.88.0 lib/avm/data/performer.rb
eac_tools-0.86.11 sub/avm/lib/avm/data/performer.rb
avm-0.87.0 lib/avm/data/performer.rb
eac_tools-0.86.8 sub/avm/lib/avm/data/performer.rb
avm-0.86.2 lib/avm/data/performer.rb
eac_tools-0.86.7 sub/avm/lib/avm/data/performer.rb