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
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
#metadata ⇒ Object (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
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_html ⇒ String
Perform an XSLT transformation to HTML using an object’s XSL
45 46 47 |
# File 'lib/geo_combine.rb', line 45 def to_html xsl_html.transform(@metadata).to_html end |