Module: Messaging::Handle::Info
Instance Method Summary collapse
- #handler(message_or_message_data) ⇒ Object
- #handler_method_name(message_or_message_data) ⇒ Object
- #handles?(message_or_message_data) ⇒ Boolean
Instance Method Details
#handler(message_or_message_data) ⇒ Object
88 89 90 91 92 93 94 95 96 |
# File 'lib/messaging/handle.rb', line 88 def handler() handler_method_name = handler_method_name() if method_defined?(handler_method_name) return handler_method_name else return nil end end |
#handler_method_name(message_or_message_data) ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/messaging/handle.rb', line 102 def handler_method_name() name = nil if .is_a? MessageStore::MessageData::Read name = Messaging::Message::Info.canonize_name(.type) elsif .is_a? String name = Messaging::Message::Info.canonize_name() else name = . end "handle_#{name}".to_sym end |
#handles?(message_or_message_data) ⇒ Boolean
98 99 100 |
# File 'lib/messaging/handle.rb', line 98 def handles?() method_defined? handler_method_name() end |