This module is a mixin for Research Object provenance information.
To use this module simply provide an (optionally private) method named ‘structure’ which returns the internal fields of the object as a Hash.
Fields added by this mixin are:
Return the Agent that created this Research Object.
# File lib/ro-bundle/ro/provenance.rb, line 75 def created_by structure[:createdBy] end
# File lib/ro-bundle/ro/provenance.rb, line 85 def created_by=(new_creator) unless new_creator.instance_of?(Agent) new_creator = Agent.new(new_creator.to_s) end @edited = true structure[:createdBy] = new_creator end
Return the time that this RO Bundle was created as a Time object, or
nil if not present in the manifest.
# File lib/ro-bundle/ro/provenance.rb, line 99 def created_on Util.parse_time(structure[:createdOn]) end
Set a new createdOn time for this Manifest. Anything that Ruby can interpret as a time is accepted and converted to ISO8601 format on serialization.
# File lib/ro-bundle/ro/provenance.rb, line 109 def created_on=(new_time) @edited = true set_time(:createdOn, new_time) end