Module: Actor::HandleMacro::MethodName
- Defined in:
- lib/actor/handle_macro.rb
Constant Summary collapse
- PATTERN =
%r{(?:\A|[a-z0-9])[A-Z]}
Class Method Summary collapse
Class Method Details
.get(message_pattern) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/actor/handle_macro.rb', line 13 def self.get case when Class, String then = .to_s *, = .split '::' .gsub! PATTERN do |str| str.downcase! str.insert 1, '_' if str.length == 2 str end get .to_sym when Symbol then :"handle_#{message_pattern}" else get .class end end |