Sha256: 5180a99f18c7c2818f0a3115c179ab746a1d84f47dd16425300b7a75f3ab7355

Contents?: true

Size: 501 Bytes

Versions: 5

Compression:

Stored size: 501 Bytes

Contents

module Riak
  module Crdt
    class InnerRegister < String
      attr_reader :parent
      
      def initialize(parent, *args, &block)
        @parent = parent
        super(*args, &block)
        freeze
      end

      def self.update(value)
        Operation::Update.new.tap do |op|
          op.value = value
          op.type = :register
        end
      end

      def self.delete
        Operation::Delete.new.tap do |op|
          op.type = :register
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
riak-client-2.2.0.pre1 lib/riak/crdt/inner_register.rb
riak-client-2.1.0 lib/riak/crdt/inner_register.rb
riak-client-2.0.0 lib/riak/crdt/inner_register.rb
riak-client-2.0.0.rc2 lib/riak/crdt/inner_register.rb
riak-client-2.0.0.rc1 lib/riak/crdt/inner_register.rb