Sha256: 4763371898c5b2664673963c5e97130dfcf3417bbaf0f32edfab59564dba3187

Contents?: true

Size: 279 Bytes

Versions: 16

Compression:

Stored size: 279 Bytes

Contents

module LedgerSync
  module Validatable
    def valid?
      validate.success?
    end

    def validate
      raise NotImplementedError
    end

    def validate_or_fail
      if valid?
        Resonad.Success(self)
      else
        Resonad.Failure
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ledger_sync-1.4.2 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.4.1 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.4.0 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.3.5 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.3.4 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.3.3 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.3.2 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.3.1 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.1.3 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.1.2 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.1.1 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.0.10 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.0.9 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.0.3 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.0.2 lib/ledger_sync/concerns/validatable.rb
ledger_sync-1.0.0 lib/ledger_sync/concerns/validatable.rb