Module: Coradoc::FormatModule::Interface
- Defined in:
- lib/coradoc/format_module.rb
Overview
Default implementations for optional format module methods. Format modules are auto-extended with this during registration.
Instance Method Summary collapse
- #handles_model?(_model) ⇒ Boolean
-
#parse_file_to_core(path, content = nil) ⇒ Coradoc::CoreModel::Base
Parse a file to CoreModel, handling file-specific concerns like include resolution.
- #serialize? ⇒ Boolean
Instance Method Details
#handles_model?(_model) ⇒ Boolean
25 26 27 |
# File 'lib/coradoc/format_module.rb', line 25 def handles_model?(_model) false end |
#parse_file_to_core(path, content = nil) ⇒ Coradoc::CoreModel::Base
Parse a file to CoreModel, handling file-specific concerns like include resolution. Format modules that support include directives or file-relative references should override this method.
40 41 42 |
# File 'lib/coradoc/format_module.rb', line 40 def parse_file_to_core(path, content = nil) parse_to_core(content || File.read(path)) end |
#serialize? ⇒ Boolean
29 30 31 |
# File 'lib/coradoc/format_module.rb', line 29 def serialize? true end |