def release(opts = nil)
opts = { :failed => false } if (opts == false)
failed = !opts || opts.fetch(:failed, true)
undeliverable = opts && opts[:undeliverable]
annotations = opts && opts[:annotations]
annotations = nil if annotations && annotations.empty?
if failed || undeliverable || annotations
d = Cproton.pn_delivery_local(@impl)
Cproton.pn_disposition_set_failed(d, true) if failed
Cproton.pn_disposition_set_undeliverable(d, true) if undeliverable
Codec::Data.from_object(Cproton.pn_disposition_annotations(d), annotations) if annotations
settle(MODIFIED)
else
settle(RELEASED)
end
end