Class: Libis::Metadata::Parser::DublinCoreParser
- Inherits:
-
BasicParser
- Object
- Parslet::Parser
- BasicParser
- Libis::Metadata::Parser::DublinCoreParser
- Defined in:
- lib/libis/metadata/parser/dublin_core_parser.rb
Overview
New style parsers and converters for metadata. New, not finished and untested.
Instance Method Summary collapse
Methods inherited from BasicParser
#any_quoted, #complement, #grouped, #grouped_anonymous, #transformer
Instance Method Details
#to_target(tree) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/libis/metadata/parser/dublin_core_parser.rb', line 23 def to_target(tree) tree = tree[:DC] return nil unless tree result = "xml['#{tree[:namespace]}'].#{tree[:element]}(" tree[:attributes].each {|attribute| result += "'#{attribute[:name]}' => '#{attribute[:value]}'"} result + ').text' end |