Class: TreeHaver::KaitaiTreeAnalysis

Inherits:
Struct
  • Object
show all
Defined in:
lib/tree_haver/contracts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backend_refObject

Returns the value of attribute backend_ref

Returns:

  • (Object)

    the current value of backend_ref



444
445
446
# File 'lib/tree_haver/contracts.rb', line 444

def backend_ref
  @backend_ref
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



444
445
446
# File 'lib/tree_haver/contracts.rb', line 444

def diagnostics
  @diagnostics
end

#rootObject

Returns the value of attribute root

Returns:

  • (Object)

    the current value of root



444
445
446
# File 'lib/tree_haver/contracts.rb', line 444

def root
  @root
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



444
445
446
# File 'lib/tree_haver/contracts.rb', line 444

def schema
  @schema
end

#source_byte_lengthObject

Returns the value of attribute source_byte_length

Returns:

  • (Object)

    the current value of source_byte_length



444
445
446
# File 'lib/tree_haver/contracts.rb', line 444

def source_byte_length
  @source_byte_length
end

Instance Method Details

#kindObject



445
446
447
# File 'lib/tree_haver/contracts.rb', line 445

def kind
  "kaitai-tree"
end

#to_hObject



449
450
451
452
453
454
455
456
457
458
# File 'lib/tree_haver/contracts.rb', line 449

def to_h
  {
    kind: kind,
    schema: schema,
    **(source_byte_length.nil? ? {} : { source_byte_length: source_byte_length }),
    root: root.to_h,
    backend_ref: backend_ref.to_h,
    diagnostics: (diagnostics || []).map(&:to_h)
  }
end