Class: FixedWidthFileValidator::FieldValidationError

Inherits:
Object
  • Object
show all
Defined in:
lib/fixed_width_file_validator/validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(validation, record, field_name, pos, width) ⇒ FieldValidationError



7
8
9
10
11
12
13
14
15
16
# File 'lib/fixed_width_file_validator/validator.rb', line 7

def initialize(validation, record, field_name, pos, width)
  @raw = record[:_raw]
  @line_num = record[:_line_num]
  @record = record
  @failed_field = field_name
  @failed_validation = validation
  @failed_value = record[field_name]
  @pos = pos
  @width = width
end

Instance Attribute Details

#failed_fieldObject (readonly)

Returns the value of attribute failed_field.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def failed_field
  @failed_field
end

#failed_validationObject (readonly)

Returns the value of attribute failed_validation.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def failed_validation
  @failed_validation
end

#failed_valueObject (readonly)

Returns the value of attribute failed_value.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def failed_value
  @failed_value
end

#line_numObject (readonly)

Returns the value of attribute line_num.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def line_num
  @line_num
end

#posObject (readonly)

Returns the value of attribute pos.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def pos
  @pos
end

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def raw
  @raw
end

#recordObject (readonly)

Returns the value of attribute record.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def record
  @record
end

#widthObject (readonly)

Returns the value of attribute width.



5
6
7
# File 'lib/fixed_width_file_validator/validator.rb', line 5

def width
  @width
end