Sha256: 5e48912a27c6cc22da7e3cdabd42fb393e6f7949969438b9cbf42175a93e2d7e
Contents?: true
Size: 1.52 KB
Versions: 15
Compression:
Stored size: 1.52 KB
Contents
module Ecoportal module API class GraphQL module Input module LocationStructure class ApplyCommands < Ecoportal::API::GraphQL::Base::Model passkey :id passthrough :clientMutationId passboolean :force embeds_many :commands, klass: Ecoportal::API::GraphQL::Input::LocationStructure::CommandInterface passboolean :preview def add(type, **kargs) if command = new_command(type) command.set_values(**kargs) unless kargs.empty? yield(command) if block_given? end command end private def new_command(type) case type when :archive Input::LocationStructure::ArchiveCommand.new when :unarchive Input::LocationStructure::UnarchiveCommand.new when :delete Input::LocationStructure::DeleteCommand.new when :move Input::LocationStructure::MoveCommand.new when :insert Input::LocationStructure::InsertCommand.new when :update Input::LocationStructure::UpdateCommand.new when :reoder Input::LocationStructure::ReoderCommand.new else raise "Unknown command type: '#{type}'" end end end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems