I’m using ActionWebService and defining the following API method:
api_method(:validate,
: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’
end
I get the following error when I try to invoke it:
undefined method `remote_addr’ for
#ActionWebService::Protocol::SimpleActionPackRequest:0x34bdd60
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])
end
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.
Colleen