class Licensed::Report
Attributes
name[R]
target[R]
Public Class Methods
new(name:, target:)
click to toggle source
Calls superclass method
# File lib/licensed/report.rb, line 7 def initialize(name:, target:) super() @name = name @target = target end
Public Instance Methods
all_reports()
click to toggle source
# File lib/licensed/report.rb, line 25 def all_reports result = [] result << self result.push(*reports.flat_map(&:all_reports)) end
errors()
click to toggle source
# File lib/licensed/report.rb, line 17 def errors @errors ||= [] end
reports()
click to toggle source
# File lib/licensed/report.rb, line 13 def reports @reports ||= [] end
to_h()
click to toggle source
Returns the data from the report as a hash
Calls superclass method
# File lib/licensed/report.rb, line 32 def to_h # add name, errors and warnings if they have real data output = {} output["name"] = name unless name.to_s.empty? output["errors"] = errors.dup if errors.any? output["warnings"] = warnings.dup if warnings.any? # merge the hash data from the report. command-specified data always # overwrites local data output.merge(super) end
warnings()
click to toggle source
# File lib/licensed/report.rb, line 21 def warnings @warnings ||= [] end