Class: SoberSwag::Reporting::Report::Object
- Defined in:
- lib/sober_swag/reporting/report/object.rb
Overview
Report on problems with an object.
Instance Attribute Summary collapse
-
#problems ⇒ Hash
readonly
The hash being reported on.
Instance Method Summary collapse
- #each_error ⇒ Object
-
#initialize(problems) ⇒ Object
constructor
A new instance of Object.
Methods inherited from Base
Constructor Details
#initialize(problems) ⇒ Object
Returns a new instance of Object.
9 10 11 |
# File 'lib/sober_swag/reporting/report/object.rb', line 9 def initialize(problems) @problems = problems end |
Instance Attribute Details
#problems ⇒ Hash (readonly)
Returns the hash being reported on.
15 16 17 |
# File 'lib/sober_swag/reporting/report/object.rb', line 15 def problems @problems end |
Instance Method Details
#each_error ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/sober_swag/reporting/report/object.rb', line 17 def each_error return enum_for(:each_error) unless block_given? problems.each do |k, v| v.each_error do |nested, err| yield [".#{k}", nested].reject(&:nil?).join(''), err end end end |