Class: Canon::DataModel
- Inherits:
-
Object
- Object
- Canon::DataModel
- Defined in:
- lib/canon/data_model.rb
Overview
Abstract base class for format-specific data models Provides common interface for parsing and serializing documents
Direct Known Subclasses
Class Method Summary collapse
-
.parse(input) ⇒ Object
Parse input into data model Must be implemented by subclasses.
-
.serialize(node) ⇒ String
Serialize data model node Must be implemented by subclasses.
Class Method Details
.parse(input) ⇒ Object
Parse input into data model Must be implemented by subclasses
14 15 16 |
# File 'lib/canon/data_model.rb', line 14 def parse(input) raise NotImplementedError, "#{self} must implement #parse" end |
.serialize(node) ⇒ String
Serialize data model node Must be implemented by subclasses
24 25 26 |
# File 'lib/canon/data_model.rb', line 24 def serialize(node) raise NotImplementedError, "#{self} must implement #serialize" end |