class GeoCombine::Metadata
Abstract class for GeoCombine
objects
Attributes
metadata[R]
Public Class Methods
new(metadata)
click to toggle source
Creates a new GeoCombine::Metadata
object, where metadata parameter is can be a File path or String of XML @param [String] metadata can be a File path “./tmp/edu.stanford.purl/bb/338/jh/0716/iso19139.xml” or a String of XML metadata
# File lib/geo_combine.rb, line 26 def initialize metadata metadata = File.read metadata if File.readable? metadata metadata = Nokogiri::XML(metadata) if metadata.instance_of? String @metadata = metadata end
Public Instance Methods
to_geoblacklight(fields = {})
click to toggle source
Perform an XSLT tranformation on metadata using an object's XSL @return fields additional GeoBlacklight fields to be passed to GeoCombine::Geoblacklight
on its instantiation @return [GeoCombine::Geoblacklight] the data transformed into geoblacklight schema, returned as a GeoCombine::Geoblacklight
# File lib/geo_combine.rb, line 38 def to_geoblacklight fields = {} GeoCombine::Geoblacklight.new(xsl_geoblacklight.apply_to(@metadata), fields) end
to_html()
click to toggle source
Perform an XSLT transformation to HTML using an object's XSL @return [String] the xml transformed to an HTML String
# File lib/geo_combine.rb, line 45 def to_html xsl_html.transform(@metadata).to_html end