Class: SoberSwag::Reporting::Report::List
- Defined in:
- lib/sober_swag/reporting/report/list.rb
Overview
Report errors that arose while parsing a list.
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
Instance Method Summary collapse
- #each_error ⇒ Object
-
#initialize(elements) ⇒ List
constructor
A new instance of List.
Methods inherited from Base
Constructor Details
#initialize(elements) ⇒ List
Returns a new instance of List.
10 11 12 |
# File 'lib/sober_swag/reporting/report/list.rb', line 10 def initialize(elements) @elements = elements end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
14 15 16 |
# File 'lib/sober_swag/reporting/report/list.rb', line 14 def elements @elements end |
Instance Method Details
#each_error ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/sober_swag/reporting/report/list.rb', line 16 def each_error return enum_for(:each_error) unless block_given? elements.each do |k, v| v.each_error do |nested, err| yield ["[#{k}]", nested].reject(&:nil?).join(''), err end end end |