Forum: Ruby on Rails ActionWebService API ignoring multiple return values?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Colleen (Guest)
on 2007-06-07 01:05
(Received via mailing list)
I'm using ActionWebService and defining the following API method:

             :expects => [{:id => :int}, {:value => :string}],
             :returns => [{:valid => :boolean}, {:error_message
=> :string}])

if I implement this method as follows:

def validate(id, value)
  return true, 'no error'

I get the following error when I try to invoke it:

undefined method `remote_addr' for

It seems to be expecting only one return value, with type boolean.

When I look at the AWS code, it seems to be written this way (this is
lines 36-39 in casting.rb for AWS 1.2.3):

def cast_returns(api_method, return_value) # :nodoc:
  return nil if api_method.returns.nil?
  cast(return_value, api_method.returns[0])

Am I doing something wrong? Can't AWS have more than one return value?
What should that look like in the implementation?

Thanks in advance.

This topic is locked and can not be replied to.