Sha256: 881e487f32c9e0d2a4bb73007ad419407d1122af8559fca95db8327362d2fd25

Contents?: true

Size: 857 Bytes

Versions: 4

Compression:

Stored size: 857 Bytes

Contents

require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/hash/slice'

module Replication
  module Modules
    module SemiConservative

      def unwound(**options)
        strand_class.new({
          name: options[:name],
          pairs: strand_attributes,
          origin: self
        })
      end

      def replicate(**options)
        strand_class.to_adapter.create!({
          name: options[:name],
          pairs: strand_attributes,
          origin: self
        })
      end

      def strand_attributes
        @strand_attributes = _strand_attributes
        @strand_attributes = @strand_attributes.slice(*replication_config.only) unless replication_config.only.empty?
        @strand_attributes = @strand_attributes.except(*replication_config.except) unless replication_config.except.empty?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
replication-0.3.2 lib/replication/modules/semi_conservative.rb
replication-0.3.1 lib/replication/modules/semi_conservative.rb
replication-0.3.0 lib/replication/modules/semi_conservative.rb
replication-0.2.0 lib/replication/modules/semi_conservative.rb