Class: Kumi::SchemaMetadata::Definition

Inherits:
Struct
  • Object
show all
Defined in:
lib/kumi/schema_metadata.rb

Overview

One definition: a named value or trait given by an expression over inputs and earlier definitions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#axesObject

Returns the value of attribute axes

Returns:

  • (Object)

    the current value of axes



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def axes
  @axes
end

#expressionObject

Returns the value of attribute expression

Returns:

  • (Object)

    the current value of expression



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def expression
  @expression
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def kind
  @kind
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def name
  @name
end

#read_byObject

Returns the value of attribute read_by

Returns:

  • (Object)

    the current value of read_by



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def read_by
  @read_by
end

#readsObject

Returns the value of attribute reads

Returns:

  • (Object)

    the current value of reads



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def reads
  @reads
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



35
36
37
# File 'lib/kumi/schema_metadata.rb', line 35

def type
  @type
end

Instance Method Details

#scalar?Boolean

Returns:

  • (Boolean)


36
# File 'lib/kumi/schema_metadata.rb', line 36

def scalar? = axes.empty?

#to_hObject



39
40
41
42
43
44
# File 'lib/kumi/schema_metadata.rb', line 39

def to_h
  {
    name: name, kind: kind, type: type, axes: axes,
    expression: expression, reads: reads, read_by: read_by
  }
end

#vector?Boolean

Returns:

  • (Boolean)


37
# File 'lib/kumi/schema_metadata.rb', line 37

def vector? = !axes.empty?