Class: Object

Inherits:
BasicObject
Includes:
RGFA::FieldWriter
Defined in:
lib/rgfa/field_writer.rb,
lib/rgfa/field_validator.rb

Instance Method Summary collapse

Methods included from RGFA::FieldWriter

#default_gfa_datatype, #to_gfa_field, #to_gfa_optfield

Instance Method Details

#validate_gfa_field!(datatype, fieldname = nil) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Validates the object according to the provided datatype

Parameters:

  • (defaults to: nil)

    Fieldname to use in the error msg

Raises:

  • if the object type or content is not compatible to the provided datatype

API:

  • private



81
82
83
84
85
86
# File 'lib/rgfa/field_validator.rb', line 81

def validate_gfa_field!(datatype, fieldname=nil)
  raise RGFA::FieldParser::FormatError,
    "Wrong type (#{self.class}) for field #{fieldname}\n"+
    "Content: #{self.inspect}\n"+
    "Datatype: #{datatype}"
end