Class: GeoCombine::Metadata
- Inherits:
-
Object
- Object
- GeoCombine::Metadata
- Defined in:
- lib/geo_combine.rb
Overview
Abstract class for GeoCombine objects
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(metadata) ⇒ Metadata
constructor
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.
-
#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.
-
#to_html ⇒ String
Perform an XSLT transformation to HTML using an object’s XSL.
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
27 28 29 30 31 |
# File 'lib/geo_combine.rb', line 27 def initialize() = File.read if File.readable? = Nokogiri::XML() if .instance_of? String @metadata = end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
19 20 21 |
# File 'lib/geo_combine.rb', line 19 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
39 40 41 |
# File 'lib/geo_combine.rb', line 39 def to_geoblacklight(fields = {}) GeoCombine::Geoblacklight.new(xsl_geoblacklight.apply_to(@metadata), fields) end |
#to_html ⇒ String
Perform an XSLT transformation to HTML using an object’s XSL
46 47 48 |
# File 'lib/geo_combine.rb', line 46 def to_html xsl_html.transform(@metadata).to_html end |