Class: TreeHaver::NormalizedParseResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backend_capabilityObject

Returns the value of attribute backend_capability

Returns:

  • (Object)

    the current value of backend_capability



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def backend_capability
  @backend_capability
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def diagnostics
  @diagnostics
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def 
  @metadata
end

#nodesObject

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def nodes
  @nodes
end

#okObject

Returns the value of attribute ok

Returns:

  • (Object)

    the current value of ok



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def ok
  @ok
end

#parse_error_toleranceObject

Returns the value of attribute parse_error_tolerance

Returns:

  • (Object)

    the current value of parse_error_tolerance



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def parse_error_tolerance
  @parse_error_tolerance
end

#root_idObject

Returns the value of attribute root_id

Returns:

  • (Object)

    the current value of root_id



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def root_id
  @root_id
end

#source_fragments_availableObject

Returns the value of attribute source_fragments_available

Returns:

  • (Object)

    the current value of source_fragments_available



192
193
194
# File 'lib/tree_haver/contracts.rb', line 192

def source_fragments_available
  @source_fragments_available
end

Instance Method Details

#to_hObject



203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/tree_haver/contracts.rb', line 203

def to_h
  {
    ok: ok,
    backend_capability: backend_capability.to_h,
    root_id: root_id,
    nodes: (nodes || []).map(&:to_h),
    parse_error_tolerance: parse_error_tolerance.to_h,
    source_fragments_available: source_fragments_available,
    diagnostics: diagnostics || [],
    metadata:  || {}
  }
end