Class: TreeHaver::ParserDiagnostics

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backendObject

Returns the value of attribute backend

Returns:

  • (Object)

    the current value of backend



54
55
56
# File 'lib/tree_haver/contracts.rb', line 54

def backend
  @backend
end

#backend_refObject

Returns the value of attribute backend_ref

Returns:

  • (Object)

    the current value of backend_ref



54
55
56
# File 'lib/tree_haver/contracts.rb', line 54

def backend_ref
  @backend_ref
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



54
55
56
# File 'lib/tree_haver/contracts.rb', line 54

def diagnostics
  @diagnostics
end

Instance Method Details

#to_hObject



55
56
57
58
59
60
61
# File 'lib/tree_haver/contracts.rb', line 55

def to_h
  {
    backend: backend,
    **(backend_ref ? { backend_ref: backend_ref.to_h } : {}),
    diagnostics: deep_dup(diagnostics || [])
  }
end