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



3958
3959
3960
# File 'lib/xberg/native.rb', line 3958

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object



4011
4012
4013
# File 'lib/xberg/native.rb', line 4011

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

Instance Method Details

#archive?Boolean

Returns:

  • (Boolean)


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

def archive? = false

#audio?Boolean

Returns:

  • (Boolean)


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

def audio? = false

#bibtex?Boolean

Returns:

  • (Boolean)


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

def bibtex? = false

#citation?Boolean

Returns:

  • (Boolean)


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

def citation? = false

#code?Boolean

Returns:

  • (Boolean)


4007
4008
4009
# File 'lib/xberg/native.rb', line 4007

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

#csv?Boolean

Returns:

  • (Boolean)


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

def csv? = false

#dbf?Boolean

Returns:

  • (Boolean)


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

def dbf? = false

#docx?Boolean

Returns:

  • (Boolean)


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

def docx? = false

#email?Boolean

Returns:

  • (Boolean)


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

def email? = false

#epub?Boolean

Returns:

  • (Boolean)


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

def epub? = false

#excel?Boolean

Returns:

  • (Boolean)


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

def excel? = false

#fiction_book?Boolean

Returns:

  • (Boolean)


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

def fiction_book? = false

#html?Boolean

Returns:

  • (Boolean)


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

def html? = false

#image?Boolean

Returns:

  • (Boolean)


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

def image? = false

#jats?Boolean

Returns:

  • (Boolean)


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

def jats? = false

#ocr?Boolean

Returns:

  • (Boolean)


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

def ocr? = false

#pdf?Boolean

Returns:

  • (Boolean)


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

def pdf? = false

#pptx?Boolean

Returns:

  • (Boolean)


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

def pptx? = false

#pst?Boolean

Returns:

  • (Boolean)


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

def pst? = false

#text?Boolean

Returns:

  • (Boolean)


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

def text? = false

#xml?Boolean

Returns:

  • (Boolean)


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

def xml? = false