Sha256: b49bc4e353d5c5ff4a37efe8220f333d00390c414601fcb8366741027bdbff86
Contents?: true
Size: 514 Bytes
Versions: 7
Compression:
Stored size: 514 Bytes
Contents
class Memento::ResultArray < Array def errors self.find_all{ |result| result.failed? } end def failed? self.any?{ |result| result.failed? } end def success? !failed? end end class Memento::Result attr_reader :object, :state def initialize(object, state) @object, @state = object, state end def error error = @object.errors[:memento_undo] error.present? ? error : nil end def failed? !!error end def success? !failed? end end
Version data entries
7 entries across 7 versions & 1 rubygems