Sha256: edf64d952f1439a52bd451352f1e92f9e49232a7be43e56d187e90207da006b7

Contents?: true

Size: 646 Bytes

Versions: 4

Compression:

Stored size: 646 Bytes

Contents

require 'resync'
require 'resync/client/mixins/client_delegator'

module Resync
  class Client
    module Mixins
      # A resource container that is capable of providing those resources with a {Client}
      module ResourceClientDelegate
        prepend ClientDelegator

        # Sets this object as the client provider delegate for each resource.
        # @param value [Array<Resource>] the resources for this list
        def resources=(value)
          super
          resources.each { |r| r.client_delegate = self }
        end
      end
    end
  end

  class BaseResourceList
    prepend Client::Mixins::ResourceClientDelegate
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
resync-client-0.4.7 lib/resync/client/mixins/resource_client_delegate.rb
resync-client-0.4.6 lib/resync/client/mixins/resource_client_delegate.rb
resync-client-0.4.5 lib/resync/client/mixins/resource_client_delegate.rb
resync-client-0.4.4 lib/resync/client/mixins/resource_client_delegate.rb