Class: GeoCombine::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_combine.rb

Overview

Abstract class for GeoCombine objects

Direct Known Subclasses

Fgdc, Iso19139

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Metadata

Creates a new GeoCombine::Metadata object, where metadata parameter is can be a File path or String of XML “./tmp/edu.stanford.purl/bb/338/jh/0716/iso19139.xml” or a String of XML metadata

Parameters:

  • metadata (String)

    can be a File path



26
27
28
29
30
# File 'lib/geo_combine.rb', line 26

def initialize 
   = File.read  if File.readable? 
   = Nokogiri::XML() if .instance_of? String
  @metadata = 
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



18
19
20
# File 'lib/geo_combine.rb', line 18

def 
  @metadata
end

Instance Method Details

#to_geoblacklight(fields = {}) ⇒ Object

Perform an XSLT tranformation on metadata using an object’s XSL GeoCombine::Geoblacklight on its instantiation geoblacklight schema, returned as a GeoCombine::Geoblacklight

Returns:



38
39
40
# File 'lib/geo_combine.rb', line 38

def to_geoblacklight fields = {}
  GeoCombine::Geoblacklight.new(xsl_geoblacklight.apply_to(@metadata), fields)
end

#to_htmlString

Perform an XSLT transformation to HTML using an object’s XSL

Returns:

  • (String)

    the xml transformed to an HTML String



45
46
47
# File 'lib/geo_combine.rb', line 45

def to_html
  xsl_html.transform(@metadata).to_html
end