Sha256: 2a65578e470d9a2d08a49bfc0d1fdcf0b3607e6cdb7b9e68d124ad0da70b500c
Contents?: true
Size: 926 Bytes
Versions: 40
Compression:
Stored size: 926 Bytes
Contents
module Yao module Mode def read_only!(&blk) raise unless block_given? raise_on_write_org = Yao.config.raise_on_write noop_on_write_org = Yao.config.noop_on_write Yao.config.set :noop_on_write, false if noop_on_write_org Yao.config.set :raise_on_write, true begin yield ensure Yao.config.set :raise_on_write, raise_on_write_org Yao.config.set :noop_on_write, noop_on_write_org end end def read_only(&blk) raise unless block_given? noop_on_write_org = Yao.config.noop_on_write raise_on_write_org = Yao.config.raise_on_write Yao.config.set :raise_on_write, false if raise_on_write_org Yao.config.set :noop_on_write, true begin yield ensure Yao.config.set :noop_on_write, noop_on_write_org Yao.config.set :raise_on_write, raise_on_write_org end end end end
Version data entries
40 entries across 40 versions & 1 rubygems