Class: Stic::Metadata::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/stic/metadata/parser.rb

Overview

A Metadata::Parser can be used to parse metadata from a file blob. This class defines the required interface and can be used to derive specialized implementations.

Direct Known Subclasses

Yaml

Instance Method Summary collapse

Instance Method Details

#parse(blob, str) ⇒ Object

Parse given string blob. Return [data, content] if blob parsing was successful or [nil, content] otherwise.

First argument will be corresponding file blob object e.g. to check file extension if front matter is restricted to specific file format.



17
18
19
# File 'lib/stic/metadata/parser.rb', line 17

def parse(blob, str)
  raise NotImplementedError.new "#{self.class.name}#parse must be implemented by subclass."
end