Class: Dbd::ProvenanceResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/dbd/provenance_resource.rb

Overview

A ProvenanceResource is derived from a Resource, specifically for a Provenance.

The main difference is that it does not have a provenance_subject.

Instance Attribute Summary

Attributes inherited from Resource

#subject

Instance Method Summary collapse

Methods inherited from Resource

new_subject

Methods included from Helpers::OrderedSetCollection

add_and_return_index, #each, #last, #size

Constructor Details

#initialize(options = {}) ⇒ ProvenanceResource

Build a new ProvenanceResource.

The subject can be either given as an argument or a new (random) subject is automatically set (see Resource for details).

A provenance_subject may not be given here.

Parameters:

  • (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :subject (Fact::Subject) — default: new_subject —

    Optional: the subject for the resource



17
18
19
# File 'lib/dbd/provenance_resource.rb', line 17

def initialize(options = {})
  super
end

Instance Method Details

#<<(provenance_fact) ⇒ Object

Add a ProvenanceFact (strictly only a ProvenanceFact).

Side effect on subject:

  • if it has no subject, the subject is set in a duplicate provenance_fact
  • if is has the same subject as the resource, added unchanged.
  • if it has a different subject, a SubjectError is raised.


28
29
30
# File 'lib/dbd/provenance_resource.rb', line 28

def <<(provenance_fact)
  super
end