Module: Messaging::Message::Info
Class Method Summary collapse
Instance Method Summary collapse
- #message_name(msg = self) ⇒ Object
- #message_type(msg = self) ⇒ Object
- #message_type?(type) ⇒ Boolean
Class Method Details
.canonize_name(name) ⇒ Object
54 55 56 |
# File 'lib/messaging/message.rb', line 54 def self.canonize_name(name) name.gsub(/([^\^])([A-Z])/,'\1_\2').downcase end |
.class_name(message) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/messaging/message.rb', line 58 def self.class_name() class_name = nil class_name = if .instance_of? String class_name ||= .name if .instance_of? Class class_name ||= .class.name class_name end |
Instance Method Details
#message_name(msg = self) ⇒ Object
50 51 52 |
# File 'lib/messaging/message.rb', line 50 def (msg=self) Info.canonize_name((msg)) end |
#message_type(msg = self) ⇒ Object
42 43 44 |
# File 'lib/messaging/message.rb', line 42 def (msg=self) Info.class_name(msg).split('::').last end |
#message_type?(type) ⇒ Boolean
46 47 48 |
# File 'lib/messaging/message.rb', line 46 def (type) == type end |