Class: GalterIrExporter::Export::VersionConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/galter_ir_exporter/export/version_converter.rb

Overview

Convert a single version of a GenericFile content into a PORO so that the metadata ()including pointers to the version content) can be exported in json format using to_json

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, version_graph) ⇒ VersionConverter

Create an instance of a GenericFile version containing all the metadata for json export

Parameters:

  • uri (String)

    location of version to be converted in fedora (also id of version)

  • version_graph (ActiveFedora::VersionsGraph)

    the graph of versions associated with one GenericFile (gf.content.versions)



16
17
18
19
20
# File 'lib/galter_ir_exporter/export/version_converter.rb', line 16

def initialize(uri, version_graph)
  @uri = content_uri(uri)
  @created = find_triple(RDF::Vocab::Fcrepo4.created, version_graph)
  @label = find_triple(RDF::Vocab::Fcrepo4.hasVersionLabel, version_graph)
end

Instance Attribute Details

#createdString (readonly)

version creation date extracted from the graph for the version identified by the url

Returns:

  • (String)

    the current value of created



9
10
11
# File 'lib/galter_ir_exporter/export/version_converter.rb', line 9

def created
  @created
end

#labelString (readonly)

version label extracted from the graph for the version identified by the url

Returns:

  • (String)

    the current value of label



9
10
11
# File 'lib/galter_ir_exporter/export/version_converter.rb', line 9

def label
  @label
end

#uriString (readonly)

location of version in fedora (also id of version)

Returns:

  • (String)

    the current value of uri



9
10
11
# File 'lib/galter_ir_exporter/export/version_converter.rb', line 9

def uri
  @uri
end