Sha256: 9c6e95c64da0b539029ddf581a640be2903b43be20d2f8a1bef4e51ab8f5fffc

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 Bytes

Contents

module VaultTree
  class ExternalData < Keyword

    def evaluate
      check_for_external_data
      contract.external_data(id)
    end

    def id
      vault.id
    end

    private

    def check_for_external_data
      raise(Exceptions::MissingExternalData) if missing_external_data?
    end

    def missing_external_data?
      nil_external_data? || empty_external_data?
    end

    def nil_external_data?
      contract.external_data_hash.nil?
    end

    def empty_external_data?
      contract.external_data_hash.empty?
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vault-tree-0.3.4 lib/vault-tree/keywords/external_data.rb
vault-tree-0.3.3 lib/vault-tree/keywords/external_data.rb