Sha256: 8645bbf4aa5e58ba4b219e49496a27f599dabfc87ab6b3a983c3862abe9a0841
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module ROM module Plugins module Command # Command plugin which sets input processing function via relation schema # # @api private module Schema def self.included(klass) super klass.extend(ClassInterface) end # @api private module ClassInterface # Build a command and set it input to relation's input_schema # # @see Command.build # # @return [Command] # # @api public def build(relation, **options) if options.key?(:input) || !relation.schema? super else default_input = options.fetch(:input, input) input_handler = if default_input != Hash -> tuple { relation.input_schema[input[tuple]] } else relation.input_schema end super(relation, **options, input: input_handler) end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rom-core-5.2.1 | lib/rom/plugins/command/schema.rb |