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



1008
1009
1010
# File 'lib/tree_haver/contracts.rb', line 1008

def backend_ref
  @backend_ref
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



1008
1009
1010
# File 'lib/tree_haver/contracts.rb', line 1008

def diagnostics
  @diagnostics
end

#rootObject

Returns the value of attribute root

Returns:

  • (Object)

    the current value of root



1008
1009
1010
# File 'lib/tree_haver/contracts.rb', line 1008

def root
  @root
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



1008
1009
1010
# File 'lib/tree_haver/contracts.rb', line 1008

def schema
  @schema
end

#source_byte_lengthObject

Returns the value of attribute source_byte_length

Returns:

  • (Object)

    the current value of source_byte_length



1008
1009
1010
# File 'lib/tree_haver/contracts.rb', line 1008

def source_byte_length
  @source_byte_length
end

Instance Method Details

#kindObject



1010
1011
1012
# File 'lib/tree_haver/contracts.rb', line 1010

def kind
  'kaitai-tree'
end

#to_hObject



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 'lib/tree_haver/contracts.rb', line 1014

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