Exception: NRB::BeerXML::Parser::InvalidRecordError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- NRB::BeerXML::Parser::InvalidRecordError
- Defined in:
- lib/nrb/beerxml/parser.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record, errors = {}) ⇒ InvalidRecordError
constructor
A new instance of InvalidRecordError.
- #to_s ⇒ Object
Constructor Details
#initialize(record, errors = {}) ⇒ InvalidRecordError
Returns a new instance of InvalidRecordError.
10 11 12 13 14 |
# File 'lib/nrb/beerxml/parser.rb', line 10 def initialize(record, errors={}) super nil @errors = errors @record = record end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/nrb/beerxml/parser.rb', line 8 def errors @errors end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
8 9 10 |
# File 'lib/nrb/beerxml/parser.rb', line 8 def record @record end |
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 |
# File 'lib/nrb/beerxml/parser.rb', line 16 def to_s errors.keys.inject("Invalid #{record.class} record\n") do |,key| += "#{key}=#{record.send(key)} #{errors.fetch(key)}\n" end end |