class Sampleclass
attr_reader :temp_arr,:temp_hash,:temp_str
def initialize(temp_arr,temp_hash,temp_str)
@temp_arr=temp_arr
@temp_hash=temp_hash
@temp_str=temp_str
end
class TestApi < ActionWebService::API::Base
api_method :get_me, :returns => [Sampleclass]
end
class TestController < ApplicationController
wsdl_service_name 'Test'
web_service_api TestApi
web_service_scaffold :invocation if Rails.env == 'development'
def get_me
#[get_indices(),get_stocks(),get_summary(),DateTime.now.to_s]
indices = get_indices()
stocks = get_stocks()
summary = get_summary()
current_time = DateTime.now
tempsnapshot = Snapshot.new(indices,stocks,summary,current_time)
tempsnapshot
[Sampleclass.new(['1','2',3'],
{'a' => '1',
'b' => '2' },
'something' ) ]
end
end
i got this error
Don't know how to cast Sampleclass to Sampleclass
how do i define custom classes as return paramters
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---