Module: VectorAmp::MetadataSchema

Defined in:
lib/vector_amp/metadata_schema.rb

Overview

Helpers and canonical scalar types for dataset metadata schemas.

Constant Summary collapse

STRING =
"string"
U32 =
"u32"
I32 =
"i32"
I64 =
"i64"
F32 =
"f32"
F64 =
"f64"
TYPES =
[STRING, U32, I32, I64, F32, F64].freeze

Class Method Summary collapse

Class Method Details

.field(name, type) ⇒ Object

Raises:

  • (ArgumentError)


14
15
16
17
18
# File 'lib/vector_amp/metadata_schema.rb', line 14

def self.field(name, type)
  raise ArgumentError, "unsupported metadata schema type: #{type.inspect}" unless TYPES.include?(type)

  { name: name.to_s, type: type }
end