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

Instance Method Details

#handles_model?(_model) ⇒ Boolean

Returns:

  • (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.

Parameters:

  • path (String)

    path to the source file

  • content (String, nil) (defaults to: nil)

    pre-read file content (hooks may have modified it)

Returns:



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

Returns:

  • (Boolean)


29
30
31
# File 'lib/coradoc/format_module.rb', line 29

def serialize?
  true
end