Class: Metro2::Records::K2Segment

Inherits:
Record
  • Object
show all
Defined in:
lib/metro_2/records/k2_segment.rb

Constant Summary collapse

LENGTH =
34

Instance Method Summary collapse

Methods inherited from Record

fields, #to_metro2

Methods included from Fields

#alphanumeric_const_field, #alphanumeric_field, #date_field, #monetary_field, #numeric_const_field, #numeric_field, #timestamp_field

Instance Method Details

#validate_fieldsObject



13
14
15
16
17
18
19
# File 'lib/metro_2/records/k2_segment.rb', line 13

def validate_fields
  if !purchased_from_sold_to_name.nil? &&
      purchased_from_sold_to_indicator == Metro2::PURCHASED_FROM_SOLD_TO_INDICATOR[:remove_previous]
    str = "purchased_from_sold_to_name must be blank if purchased_from_sold_to_indicator is 9"
    raise ArgumentError.new(str)
  end
end