Class: TreeHaver::ParseErrorTolerance

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



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def backend_ref
  @backend_ref
end

#behaviorObject

Returns the value of attribute behavior

Returns:

  • (Object)

    the current value of behavior



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def behavior
  @behavior
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def diagnostics
  @diagnostics
end

#error_nodesObject

Returns the value of attribute error_nodes

Returns:

  • (Object)

    the current value of error_nodes



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def error_nodes
  @error_nodes
end

#languageObject

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def language
  @language
end

#tolerates_errorsObject

Returns the value of attribute tolerates_errors

Returns:

  • (Object)

    the current value of tolerates_errors



122
123
124
# File 'lib/tree_haver/contracts.rb', line 122

def tolerates_errors
  @tolerates_errors
end

Instance Method Details

#to_hObject



124
125
126
127
128
129
130
131
132
133
# File 'lib/tree_haver/contracts.rb', line 124

def to_h
  {
    backend_ref: backend_ref.to_h,
    language: language,
    behavior: behavior,
    tolerates_errors: tolerates_errors,
    error_nodes: (error_nodes || []).map(&:to_h),
    diagnostics: diagnostics
  }
end