Module: RLSL::UniformTypes::TargetResolver

Included in:
RLSL::UniformTypes
Defined in:
lib/rlsl/types/target_resolver.rb

Instance Method Summary collapse

Instance Method Details

#target_type(type, target) ⇒ Object

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
# File 'lib/rlsl/types/target_resolver.rb', line 6

def target_type(type, target)
  spec = fetch(type)
  target_type = spec.public_send(:"#{target}_type")
  return target_type if target_type

  raise ArgumentError, "Unsupported #{target.to_s.upcase} uniform type: #{type}"
end