Class: Float

Inherits:
Object show all
Defined in:
lib/rgfa/field_writer.rb,
lib/rgfa/field_validator.rb

Instance Method Summary collapse

Instance Method Details

#default_gfa_datatypeRGFA::Line::FIELD_DATATYPE

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.

Optional field GFA datatype to use, if none is provided



57
# File 'lib/rgfa/field_writer.rb', line 57

def default_gfa_datatype; :f; end

#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:

Raises:



204
205
206
207
208
209
210
211
# File 'lib/rgfa/field_validator.rb', line 204

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