Class: Textus::Format::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/format/base.rb

Direct Known Subclasses

Json, Markdown, Text, Yaml

Class Method Summary collapse

Class Method Details

.enforce_name_match!(_path, _meta) ⇒ Object

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/textus/format/base.rb', line 36

def self.enforce_name_match!(_path, _meta)
  raise NotImplementedError.new("#{name}.enforce_name_match! not implemented")
end

.extensionsObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/textus/format/base.rb', line 16

def self.extensions
  raise NotImplementedError.new("#{name}.extensions not implemented")
end

.inject_uid(_meta, _content, _existing_uid) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/textus/format/base.rb', line 32

def self.inject_uid(_meta, _content, _existing_uid)
  raise NotImplementedError.new("#{name}.inject_uid not implemented")
end

.nested_globObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/textus/format/base.rb', line 24

def self.nested_glob
  raise NotImplementedError.new("#{name}.nested_glob not implemented")
end

.parse(_raw, path: nil) ⇒ Object

Raises:

  • (NotImplementedError)


4
5
6
7
# File 'lib/textus/format/base.rb', line 4

def self.parse(_raw, path: nil)
  _ = path
  raise NotImplementedError.new("#{name}.parse not implemented")
end

.rewrite_name(_path, _basename) ⇒ Object

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/textus/format/base.rb', line 48

def self.rewrite_name(_path, _basename)
  raise NotImplementedError.new("#{name}.rewrite_name not implemented")
end

.serialize(meta: {}, body: "", content: nil) ⇒ Object

Raises:

  • (NotImplementedError)


9
10
11
12
13
14
# File 'lib/textus/format/base.rb', line 9

def self.serialize(meta: {}, body: "", content: nil)
  _ = meta
  _ = body
  _ = content
  raise NotImplementedError.new("#{name}.serialize not implemented")
end

.serialize_for_put(meta:, body:, content:, path:) ⇒ Object

Raises:

  • (NotImplementedError)


40
41
42
43
44
45
46
# File 'lib/textus/format/base.rb', line 40

def self.serialize_for_put(meta:, body:, content:, path:)
  _ = meta
  _ = body
  _ = content
  _ = path
  raise NotImplementedError.new("#{name}.serialize_for_put not implemented")
end

.validate_against(schema, parsed) ⇒ Object



20
21
22
# File 'lib/textus/format/base.rb', line 20

def self.validate_against(schema, parsed)
  schema.validate!(parsed["_meta"] || {})
end

.validate_path_extension(_path, _nested) ⇒ Object

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/textus/format/base.rb', line 28

def self.validate_path_extension(_path, _nested)
  raise NotImplementedError.new("#{name}.validate_path_extension not implemented")
end