Class: BadRecord

Inherits:
Struct show all
Defined in:
lib/wukong/bad_record.rb

Overview

Easily serialize bad records in-band, for later analysis or to discard if neglectable.

You can instantiate this as

success = do_stuff_to record
if ! success
  return BadRecord.new("do_stuff_to-failed", record)
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors = '', *record_fields) ⇒ BadRecord

Returns a new instance of BadRecord.



15
16
17
# File 'lib/wukong/bad_record.rb', line 15

def initialize errors='', *record_fields
  super errors, record_fields
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



11
12
13
# File 'lib/wukong/bad_record.rb', line 11

def errors
  @errors
end

#recordObject

Returns the value of attribute record

Returns:

  • (Object)

    the current value of record



11
12
13
# File 'lib/wukong/bad_record.rb', line 11

def record
  @record
end