Permalink
Browse files

add store_service

  • Loading branch information...
1 parent da03881 commit 14f54a1d78004580b60a8d0a4d7aeb77ba5e4edf @sridatta sridatta committed Jun 21, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/bridge-ruby.rb
View
@@ -206,6 +206,26 @@ def publish_service name, handler, &callback
end
# :call-seq:
+ # store_service(name, handler)
+ #
+ # Stores a Ruby object or module as a Bridge service with the given
+ # name.
+ #
+ # === Attributes
+ #
+ # +name+:: The name of the Bridge service the handler will be stored
+ # under
+ # +handler+:: A Ruby object or module to store
+ #
+ def store_service name, handler
+ if name == 'system'
+ Util.error("Invalid service name: #{name}")
+ else
+ @store[name] = handler
+ end
+ end
+
+ # :call-seq:
# unpublish_service(name, handler) { |name| block }
#
# Stops publishing a ruby object or module as a Bridge service with the
@@ -316,6 +336,8 @@ def get_channel name, &callback
# +handler+:: A remote object, ruby object or module to handle method
# calls from the channel
+ #
+ # +writeable+:: Whether the handler's creator may write to the channel
def join_channel name, handler, writeable = true, &callback
@connection.send_command(
:JOINCHANNEL,

0 comments on commit 14f54a1

Please sign in to comment.