Class: Krikri::OriginalRecordEntityBehavior

Inherits:
EntityBehavior show all
Defined in:
lib/krikri/entity_behaviors/original_record_entity_behavior.rb

Overview

A behavior that provides methods for working with original records (as defined by Krikri::OriginalRecord), in the context of entities that are generated by activities.

See Also:

Instance Attribute Summary

Attributes inherited from EntityBehavior

#activity

Instance Method Summary collapse

Methods inherited from EntityBehavior

entities, #initialize

Constructor Details

This class inherits a constructor from Krikri::EntityBehavior

Instance Method Details

#entities(load = true, include_invalidated = false) ⇒ Enumerator

Returns OriginalRecord objects.

Parameters:

  • load (Boolean) (defaults to: true)

    Whether to load the whole record from the LDP server. OriginalRecord.load is slow, because it results in a network request, so this provides the possibility of avoiding it. Default: true.

  • include_invalidated (Boolean) (defaults to: false)

    Whether to include entities that have been invalidated with prov:invalidatedAtTime. Default: false

Returns:

  • (Enumerator)

    OriginalRecord objects

See Also:

  • EntityBehavior::entities


25
26
27
28
29
# File 'lib/krikri/entity_behaviors/original_record_entity_behavior.rb', line 25

def entities(load = true, include_invalidated = false)
  activity_uris(include_invalidated) do |uri|
    load ? OriginalRecord.load(uri) : OriginalRecord.new(uri)
  end
end