Class: GeoCombine::Metadata
- Inherits:
-
Object
- Object
- GeoCombine::Metadata
- Defined in:
- lib/geo_combine.rb
Overview
Abstract class for GeoCombine objects
Direct Known Subclasses
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 ⇒ GeoCombine::Geoblacklight
Perform an XSLT tranformation on metadata using an object’s XSL.
-
#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
23 24 25 26 27 |
# File 'lib/geo_combine.rb', line 23 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.
15 16 17 |
# File 'lib/geo_combine.rb', line 15 def @metadata end |
Instance Method Details
#to_geoblacklight ⇒ GeoCombine::Geoblacklight
Perform an XSLT tranformation on metadata using an object’s XSL
32 33 34 |
# File 'lib/geo_combine.rb', line 32 def to_geoblacklight GeoCombine::Geoblacklight.new(xsl_geoblacklight.transform(@metadata)) end |
#to_html ⇒ String
Perform an XSLT transformation to HTML using an object’s XSL
39 40 41 |
# File 'lib/geo_combine.rb', line 39 def to_html xsl_html.transform(@metadata).to_html end |