ActionWebService API ignoring multiple return values?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs