Class: Xberg::FormatMetadataCode
- Inherits:
-
Data
- Object
- Data
- Xberg::FormatMetadataCode
- 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
-
#value ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
- #archive? ⇒ Boolean
- #audio? ⇒ Boolean
- #bibtex? ⇒ Boolean
- #citation? ⇒ Boolean
- #code? ⇒ Boolean
- #csv? ⇒ Boolean
- #dbf? ⇒ Boolean
- #docx? ⇒ Boolean
- #email? ⇒ Boolean
- #epub? ⇒ Boolean
- #excel? ⇒ Boolean
- #fiction_book? ⇒ Boolean
- #html? ⇒ Boolean
- #image? ⇒ Boolean
- #jats? ⇒ Boolean
- #ocr? ⇒ Boolean
- #pdf? ⇒ Boolean
- #pptx? ⇒ Boolean
- #pst? ⇒ Boolean
- #text? ⇒ Boolean
- #xml? ⇒ Boolean
Instance Attribute Details
#value ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
4060 4061 4062 |
# File 'lib/xberg/native.rb', line 4060 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
4113 4114 4115 |
# File 'lib/xberg/native.rb', line 4113 def self.from_hash(hash) new(value: hash[:_0] || hash["_0"]) end |
Instance Method Details
#archive? ⇒ Boolean
4079 |
# File 'lib/xberg/native.rb', line 4079 def archive? = false |
#audio? ⇒ Boolean
4107 |
# File 'lib/xberg/native.rb', line 4107 def audio? = false |
#bibtex? ⇒ Boolean
4093 |
# File 'lib/xberg/native.rb', line 4093 def bibtex? = false |
#citation? ⇒ Boolean
4095 |
# File 'lib/xberg/native.rb', line 4095 def citation? = false |
#code? ⇒ Boolean
4109 4110 4111 |
# File 'lib/xberg/native.rb', line 4109 def code? = true # @param hash [Hash] deserialized from the native extension # @return [self] |
#csv? ⇒ Boolean
4091 |
# File 'lib/xberg/native.rb', line 4091 def csv? = false |
#dbf? ⇒ Boolean
4099 |
# File 'lib/xberg/native.rb', line 4099 def dbf? = false |
#docx? ⇒ Boolean
4071 |
# File 'lib/xberg/native.rb', line 4071 def docx? = false |
#email? ⇒ Boolean
4075 |
# File 'lib/xberg/native.rb', line 4075 def email? = false |
#epub? ⇒ Boolean
4103 |
# File 'lib/xberg/native.rb', line 4103 def epub? = false |
#excel? ⇒ Boolean
4073 |
# File 'lib/xberg/native.rb', line 4073 def excel? = false |
#fiction_book? ⇒ Boolean
4097 |
# File 'lib/xberg/native.rb', line 4097 def fiction_book? = false |
#html? ⇒ Boolean
4087 |
# File 'lib/xberg/native.rb', line 4087 def html? = false |
#image? ⇒ Boolean
4081 |
# File 'lib/xberg/native.rb', line 4081 def image? = false |
#jats? ⇒ Boolean
4101 |
# File 'lib/xberg/native.rb', line 4101 def jats? = false |
#ocr? ⇒ Boolean
4089 |
# File 'lib/xberg/native.rb', line 4089 def ocr? = false |
#pdf? ⇒ Boolean
4069 |
# File 'lib/xberg/native.rb', line 4069 def pdf? = false |
#pptx? ⇒ Boolean
4077 |
# File 'lib/xberg/native.rb', line 4077 def pptx? = false |
#pst? ⇒ Boolean
4105 |
# File 'lib/xberg/native.rb', line 4105 def pst? = false |
#text? ⇒ Boolean
4085 |
# File 'lib/xberg/native.rb', line 4085 def text? = false |
#xml? ⇒ Boolean
4083 |
# File 'lib/xberg/native.rb', line 4083 def xml? = false |