1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
Leon Breedt 4f2f408ba1 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
2005-03-10 11:53:29 +00:00

34 lines
854 B
Ruby

require 'blogger_api'
class BloggerService < ActionWebService::Base
web_service_api BloggerAPI
def initialize
@postid = 0
end
def newPost(key, id, user, pw, content, publish)
$stderr.puts "id=#{id} user=#{user} pw=#{pw}, content=#{content.inspect} [#{publish}]"
(@postid += 1).to_s
end
def editPost(key, post_id, user, pw, content, publish)
$stderr.puts "id=#{post_id} user=#{user} pw=#{pw} content=#{content.inspect} [#{publish}]"
true
end
def getUsersBlogs(key, user, pw)
$stderr.puts "getting blogs for #{user}"
blog = Blog::Blog.new(
:url =>'http://blog',
:blogid => 'myblog',
:blogName => 'My Blog'
)
[blog]
end
def getUserInfo(key, user, pw)
$stderr.puts "getting user info for #{user}"
Blog::User.new(:nickname => 'user', :email => 'user@test.com')
end
end