def call_method_with_optional_parameters(object, method_name, parameters)
        if object.respond_to?(method_name)
          if object.method(method_name).arity == -1
            object.send(method_name, parameters)
          else
            object.send(method_name)
          end
        end
      end
def call_method_with_optional_parameters(object, method_name, parameters)
        if object.respond_to?(method_name)
          if object.method(method_name).arity == -1
            object.send(method_name, parameters)
          else
            object.send(method_name)
          end
        end
      end
Helper to not call to_hash with the wrong number of arguments