From 4f2f408ba1a7dd976a1ec5061d05ef0439e5f942 Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Thu, 10 Mar 2005 11:53:29 +0000 Subject: allow 0, 1, '0' or '1' to be cast to the appropriate values for boolean values. update XML-RPC example to work in :layered mode. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../examples/metaWeblog/apis/blogger_api.rb | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 actionwebservice/examples/metaWeblog/apis/blogger_api.rb (limited to 'actionwebservice/examples/metaWeblog/apis/blogger_api.rb') diff --git a/actionwebservice/examples/metaWeblog/apis/blogger_api.rb b/actionwebservice/examples/metaWeblog/apis/blogger_api.rb new file mode 100644 index 0000000000..9f85a2391e --- /dev/null +++ b/actionwebservice/examples/metaWeblog/apis/blogger_api.rb @@ -0,0 +1,60 @@ +# +# see the blogger API spec at http://www.blogger.com/developers/api/1_docs/ +# note that the method signatures are subtly different to metaWeblog, they +# are not identical. take care to ensure you handle the different semantics +# properly if you want to support blogger API too, to get maximum compatibility. +# + +module Blog + class Blog < ActionWebService::Struct + member :url, :string + member :blogid, :string + member :blogName, :string + end + + class User < ActionWebService::Struct + member :nickname, :string + member :userid, :string + member :url, :string + member :email, :string + member :lastname, :string + member :firstname, :string + end +end + +# +# blogger +# +class BloggerAPI < ActionWebService::API::Base + inflect_names false + + api_method :newPost, :returns => [:string], :expects => [ + {:appkey=>:string}, + {:blogid=>:string}, + {:username=>:string}, + {:password=>:string}, + {:content=>:string}, + {:publish=>:bool} + ] + + api_method :editPost, :returns => [:bool], :expects => [ + {:appkey=>:string}, + {:postid=>:string}, + {:username=>:string}, + {:password=>:string}, + {:content=>:string}, + {:publish=>:bool} + ] + + api_method :getUsersBlogs, :returns => [[Blog::Blog]], :expects => [ + {:appkey=>:string}, + {:username=>:string}, + {:password=>:string} + ] + + api_method :getUserInfo, :returns => [Blog::User], :expects => [ + {:appkey=>:string}, + {:username=>:string}, + {:password=>:string} + ] +end -- cgit v1.2.3