Class: NxtSchema::Template::TypeSystemResolver

Inherits:
Object
  • Object
show all
Includes:
NxtInit
Defined in:
lib/nxt_schema/template/type_system_resolver.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/nxt_schema/template/type_system_resolver.rb', line 9

def call
  type_system = options.fetch(:type_system) { parent_node&.type_system }

  if type_system.is_a?(Module)
    type_system
  elsif type_system.is_a?(Symbol) || type_system.is_a?(String)
    "NxtSchema::Types::#{type_system.to_s.classify}".constantize
  else
    NxtSchema::Types
  end
end