Class: Kumi::SchemaMetadata::InputField

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

Overview

One input leaf: a typed, optionally domain-bounded free variable.

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



19
20
21
# File 'lib/kumi/schema_metadata.rb', line 19

def axes
  @axes
end

#domainObject

Returns the value of attribute domain

Returns:

  • (Object)

    the current value of domain



19
20
21
# File 'lib/kumi/schema_metadata.rb', line 19

def domain
  @domain
end

#element_pathObject

Returns the value of attribute element_path

Returns:

  • (Object)

    the current value of element_path



19
20
21
# File 'lib/kumi/schema_metadata.rb', line 19

def element_path
  @element_path
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



19
20
21
# File 'lib/kumi/schema_metadata.rb', line 19

def path
  @path
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



19
20
21
# File 'lib/kumi/schema_metadata.rb', line 19

def type
  @type
end

Instance Method Details

#addressObject

Dotted address, e.g. “scenarios.scenario.claiming_age”.



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

def address = path.join(".")

#in_arrayObject

Whether the leaf lives inside one or more arrays.



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

def in_array = !axes.empty?

#to_hObject



26
27
28
29
30
# File 'lib/kumi/schema_metadata.rb', line 26

def to_h
  h = { path: path, address: address, type: type, axes: axes, element_path: element_path }
  h[:domain] = domain.to_s if domain
  h
end