Class: Xberg::FormatMetadataCode

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
FormatMetadata
Defined in:
lib/xberg/native.rb

Overview

Code (tree-sitter analyzable source). Carries the structural chunks (function, class, and module boundaries) produced by the tree-sitter extractor, consumed by the chunking pipeline to emit structure-aware Chunks instead of falling back to text-based splitting.

Wraps [CodeMetadata] (a named struct) rather than Vec<CodeChunkInfo> directly: FormatMetadata is internally tagged (#[serde(tag = "format_type")]), and serde cannot serialize a tagged newtype variant that wraps a sequence — the tag has no map to live in. Wrapping a struct gives serde a map to hold the tag, and keeps this variant shape consistent with every sibling (Variant(XMetadata)) so the derived OpenAPI discriminator can reference a named component schema.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4033
4034
4035
# File 'lib/xberg/native.rb', line 4033

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object



4086
4087
4088
# File 'lib/xberg/native.rb', line 4086

def self.from_hash(hash)
  new(value: hash[:_0] || hash["_0"])
end

Instance Method Details

#archive?Boolean

Returns:

  • (Boolean)


4052
# File 'lib/xberg/native.rb', line 4052

def archive? = false

#audio?Boolean

Returns:

  • (Boolean)


4080
# File 'lib/xberg/native.rb', line 4080

def audio? = false

#bibtex?Boolean

Returns:

  • (Boolean)


4066
# File 'lib/xberg/native.rb', line 4066

def bibtex? = false

#citation?Boolean

Returns:

  • (Boolean)


4068
# File 'lib/xberg/native.rb', line 4068

def citation? = false

#code?Boolean

Returns:

  • (Boolean)


4082
4083
4084
# File 'lib/xberg/native.rb', line 4082

def code? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]

#csv?Boolean

Returns:

  • (Boolean)


4064
# File 'lib/xberg/native.rb', line 4064

def csv? = false

#dbf?Boolean

Returns:

  • (Boolean)


4072
# File 'lib/xberg/native.rb', line 4072

def dbf? = false

#docx?Boolean

Returns:

  • (Boolean)


4044
# File 'lib/xberg/native.rb', line 4044

def docx? = false

#email?Boolean

Returns:

  • (Boolean)


4048
# File 'lib/xberg/native.rb', line 4048

def email? = false

#epub?Boolean

Returns:

  • (Boolean)


4076
# File 'lib/xberg/native.rb', line 4076

def epub? = false

#excel?Boolean

Returns:

  • (Boolean)


4046
# File 'lib/xberg/native.rb', line 4046

def excel? = false

#fiction_book?Boolean

Returns:

  • (Boolean)


4070
# File 'lib/xberg/native.rb', line 4070

def fiction_book? = false

#html?Boolean

Returns:

  • (Boolean)


4060
# File 'lib/xberg/native.rb', line 4060

def html? = false

#image?Boolean

Returns:

  • (Boolean)


4054
# File 'lib/xberg/native.rb', line 4054

def image? = false

#jats?Boolean

Returns:

  • (Boolean)


4074
# File 'lib/xberg/native.rb', line 4074

def jats? = false

#ocr?Boolean

Returns:

  • (Boolean)


4062
# File 'lib/xberg/native.rb', line 4062

def ocr? = false

#pdf?Boolean

Returns:

  • (Boolean)


4042
# File 'lib/xberg/native.rb', line 4042

def pdf? = false

#pptx?Boolean

Returns:

  • (Boolean)


4050
# File 'lib/xberg/native.rb', line 4050

def pptx? = false

#pst?Boolean

Returns:

  • (Boolean)


4078
# File 'lib/xberg/native.rb', line 4078

def pst? = false

#text?Boolean

Returns:

  • (Boolean)


4058
# File 'lib/xberg/native.rb', line 4058

def text? = false

#xml?Boolean

Returns:

  • (Boolean)


4056
# File 'lib/xberg/native.rb', line 4056

def xml? = false