Class: SoberSwag::Reporting::Report::MergedObject

Inherits:
Base
  • Object
show all
Defined in:
lib/sober_swag/reporting/report/merged_object.rb

Overview

Report on problems with a merged object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#full_errors, #path_hash

Constructor Details

#initialize(parent, child) ⇒ MergedObject

Returns a new instance of MergedObject.



7
8
9
10
# File 'lib/sober_swag/reporting/report/merged_object.rb', line 7

def initialize(parent, child)
  @parent = parent
  @child = child
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



12
13
14
# File 'lib/sober_swag/reporting/report/merged_object.rb', line 12

def child
  @child
end

#parentObject (readonly)

Returns the value of attribute parent.



12
13
14
# File 'lib/sober_swag/reporting/report/merged_object.rb', line 12

def parent
  @parent
end

Instance Method Details

#each_errorObject



14
15
16
17
18
19
20
21
# File 'lib/sober_swag/reporting/report/merged_object.rb', line 14

def each_error
  return enum_for(:each_error) unless block_given?

  # rubocop:disable Style/ExplicitBlockArgument
  parent.each_error { |k, v| yield k, v }
  child.each_error { |k, v| yield k, v }
  # rubocop:enable Style/ExplicitBlockArgument
end