Class: Licensed::Reporters::Reporter::Report

Inherits:
Hash
  • Object
show all
Defined in:
lib/licensed/reporters/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, target:) ⇒ Report

Returns a new instance of Report.



8
9
10
11
12
# File 'lib/licensed/reporters/reporter.rb', line 8

def initialize(name:, target:)
  super()
  @name = name
  @target = target
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/licensed/reporters/reporter.rb', line 6

def name
  @name
end

#targetObject (readonly)

Returns the value of attribute target.



7
8
9
# File 'lib/licensed/reporters/reporter.rb', line 7

def target
  @target
end

Instance Method Details

#all_reportsObject



26
27
28
29
30
# File 'lib/licensed/reporters/reporter.rb', line 26

def all_reports
  result = []
  result << self
  result.push(*reports.flat_map(&:all_reports))
end

#errorsObject



18
19
20
# File 'lib/licensed/reporters/reporter.rb', line 18

def errors
  @errors ||= []
end

#reportsObject



14
15
16
# File 'lib/licensed/reporters/reporter.rb', line 14

def reports
  @reports ||= []
end

#warningsObject



22
23
24
# File 'lib/licensed/reporters/reporter.rb', line 22

def warnings
  @warnings ||= []
end