module MiGA::Dataset::Type
def check_type
If the dataset type is +:empty+, it returns +false+ without raising an
project type and raise an exception if any of these checks fail
Check that the dataset type is defined, known, and compatible with the
#
def check_type raise MiGA::Error.new('Undefined dataset type') unless type return false if type == :empty unless self.class.KNOWN_TYPES[type] raise MiGA::Error.new("Unknown dataset type: #{type}") end unless self.class.KNOWN_TYPES[type][:project_types].include? project.type raise MiGA::Error.new( "Dataset type (#{type}) incompatible with project (#{project.type})" ) end true end
def markers?
#
def markers? self.class.KNOWN_TYPES.dig(type, :markers) end
def multi?
#
def multi? self.class.KNOWN_TYPES.dig(type, :multi) end
def nonmulti?
#
def nonmulti? y = self.class.KNOWN_TYPES.dig(type, :multi) y.nil? ? nil : !y end
def type
#
def type metadata[:type] end