Class: RubyHaze::Topic
- Inherits:
-
Object
- Object
- RubyHaze::Topic
- Includes:
- Mixins::DOProxy
- Defined in:
- lib/rubyhaze/topic.rb
Instance Attribute Summary
Attributes included from Mixins::DOProxy
Attributes included from Mixins::Proxy
Instance Method Summary collapse
-
#initialize(name) ⇒ Topic
constructor
A new instance of Topic.
- #on_message(&blk) ⇒ Object
Methods included from Mixins::DOProxy
Methods included from Mixins::NativeException
Methods included from Mixins::Compare
Methods included from Mixins::Proxy
included, #method_missing, #respond_to?
Constructor Details
#initialize(name) ⇒ Topic
Returns a new instance of Topic.
9 10 11 12 |
# File 'lib/rubyhaze/topic.rb', line 9 def initialize(name) @name = name.to_s @proxy_object = Hazelcast.get_topic @name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RubyHaze::Mixins::Proxy
Instance Method Details
#on_message(&blk) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rubyhaze/topic.rb', line 14 def (&blk) klass = Class.new klass.send :include, MessageListener klass.send :define_method, :on_message, &blk proxy_object. klass.new end |