class Object

Public Instance Methods

validate_gfa_field!(datatype, fieldname=nil) click to toggle source

@!macro [new] validate_gfa_field

Validates the object according to the provided datatype
@param datatype [RGFA::Line::FIELD_DATATYPE]
@param fieldname [#to_s] Fieldname to use in the error msg
@raise [RGFA::FieldParser::FormatError] if the object type or content
  is not compatible to the provided datatype
@return [void]
@api private
# 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