Sha256: 18364b0a9c3876ddf4fb45e834211dadaf3d98c42cfb80bb8063c0e9d3c3caa8

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

module VaultTree
  class CloseValidator
    attr_reader :vault

    def initialize(vault)
      @vault = vault
    end

    def validate!
      confirm_valid_fill_keyword
      true
    end

    private

    def confirm_valid_fill_keyword
      raise Exceptions::FillAttemptMasterPassword if vault.fill_with == 'MASTER_PASSPHRASE'
    end

    def external_data_required?
      vault.fill_with == 'EXTERNAL_DATA'
    end

    def external_data_missing?
      vault.contract.external_data(vault.id).nil?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vault-tree-0.3.4 lib/vault-tree/contract/close_validator.rb
vault-tree-0.3.3 lib/vault-tree/contract/close_validator.rb