class LicenseScout::Reporter::Result

Attributes

dependency[R]
reason[R]

Public Class Methods

failure(dependency, reason) click to toggle source
# File lib/license_scout/reporter.rb, line 32
def failure(dependency, reason)
  new(dependency, reason, false)
end
new(dependency, reason, did_succeed) click to toggle source
# File lib/license_scout/reporter.rb, line 40
def initialize(dependency, reason, did_succeed)
  @dependency = dependency
  @reason = reason
  @did_succeed = did_succeed
end
success(dependency) click to toggle source
# File lib/license_scout/reporter.rb, line 28
def success(dependency)
  new(dependency, nil, true)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/license_scout/reporter.rb, line 46
def <=>(other)
  dependency.path <=> other.dependency.path
end
dependency_string() click to toggle source
# File lib/license_scout/reporter.rb, line 54
def dependency_string
  dependency.uid
end
license_string() click to toggle source
# File lib/license_scout/reporter.rb, line 58
def license_string
  dependency.license.records.map(&:id).compact.uniq.join(", ")
end
reason_string() click to toggle source
# File lib/license_scout/reporter.rb, line 62
def reason_string
  case reason
  when :not_allowed
    "Not Allowed"
  when :flagged
    "Flagged"
  when :undetermined
    "Undetermined"
  when :missing
    "Missing"
  else
    "OK"
  end
end
succeeded?() click to toggle source
# File lib/license_scout/reporter.rb, line 50
def succeeded?
  @did_succeed
end