Sha256: 6c86785e2e3bfe7194f1f59ffb08cf54b9322b36f4df0f5fd019e794448422b8

Contents?: true

Size: 492 Bytes

Versions: 7

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

module Acfs
  module Util
    # TODO: Merge wit features in v1.0
    module Callbacks
      def __callbacks__
        @__callbacks__ ||= []
      end

      def __invoke__
        __callbacks__.each {|c| c.call self }
      end
    end

    # TODO: Replace delegator with promise or future for the long run.
    class ResourceDelegator < SimpleDelegator
      delegate :class, :is_a?, :kind_of?, :nil?, to: :__getobj__
      include Callbacks
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
acfs-2.0.0 lib/acfs/util.rb
acfs-1.7.0 lib/acfs/util.rb
acfs-1.6.0 lib/acfs/util.rb
acfs-1.5.1 lib/acfs/util.rb
acfs-1.5.0 lib/acfs/util.rb
acfs-1.4.0 lib/acfs/util.rb
acfs-1.3.4 lib/acfs/util.rb