Class: Mxrb::Compiler::CompatibilityReport

Inherits:
Data
  • Object
show all
Defined in:
lib/mxrb/compiler/compatibility_analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#findingsObject (readonly)

Returns the value of attribute findings

Returns:

  • (Object)

    the current value of findings



9
10
11
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 9

def findings
  @findings
end

#mendix_versionObject (readonly)

Returns the value of attribute mendix_version

Returns:

  • (Object)

    the current value of mendix_version



9
10
11
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 9

def mendix_version
  @mendix_version
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



9
10
11
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 9

def path
  @path
end

#statsObject (readonly)

Returns the value of attribute stats

Returns:

  • (Object)

    the current value of stats



9
10
11
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 9

def stats
  @stats
end

Instance Method Details

#compatible?Boolean

Returns:

  • (Boolean)


10
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 10

def compatible? = findings.none? { _1.severity == :error }

#errorsObject



11
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 11

def errors = findings.select { _1.severity == :error }

#to_hObject



14
15
16
17
18
19
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 14

def to_h
  {
    path:, mendix_version:, compatible: compatible?, stats:,
    findings: findings.map(&:to_h)
  }
end

#warningsObject



12
# File 'lib/mxrb/compiler/compatibility_analyzer.rb', line 12

def warnings = findings.select { _1.severity == :warning }