Method: Soaspec::SoapHandler.method_missing

Defined in:
lib/soaspec/exchange_handlers/soap_handler.rb

.method_missing(method_name, *args, &block) ⇒ Object

Implement undefined setter with []= for FactoryBot to use without needing to define params to set

Parameters:

  • method_name (Object)

    Name of method not defined

  • args (Object)

    Arguments passed to method

  • block (Object)


211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/soaspec/exchange_handlers/soap_handler.rb', line 211

def method_missing(method_name, *args, &block)
  tmp_class = new(method_name)
  operations = tmp_class.operations
  if operations.include? method_name
    tmp_class.operation = method_name
    exchange = Exchange.new(method_name, *args)
    exchange.exchange_handler = tmp_class
    yield exchange if block_given?
    exchange
  else
    super
  end
end