Sha256: 2ea26a6c7724449910c1b78f11471da2dfeffd81e2b8ad2cdc64abcb8ade8a84
Contents?: true
Size: 768 Bytes
Versions: 18
Compression:
Stored size: 768 Bytes
Contents
module Imap; end module Imap::Backup class Serializer::Transaction attr_reader :owner attr_reader :data def initialize(owner:) @data = nil @owner = owner @in_transaction = false end def begin(data, &block) @data = data @in_transaction = true block.call @in_transaction = false end def clear @data = nil end def in_transaction? @in_transaction end def fail_in_transaction!(method, message: "not supported inside trasactions") raise "#{owner.class}##{method} #{message}" if in_transaction? end def fail_outside_transaction!(method) raise "#{owner.class}##{method} can only be called inside a transaction" if !in_transaction? end end end
Version data entries
18 entries across 18 versions & 1 rubygems