Module: Vigilem::Core::EventHandler::Utils
- Included in:
- Vigilem::Core::EventHandler, Vigilem::Core::EventHandler, ClassMethods
- Defined in:
- lib/vigilem/core/event_handler.rb
Instance Method Summary collapse
-
#on_format?(str) ⇒ TrueClass || FalseClass
does the string passed in start with ‘on_’.
- #respond_to?(sym, include_all = false) ⇒ TrueClass || FalseClass
- #snakecase_class_name(namespace) ⇒ String
-
#type_from_on_format(on_name) ⇒ Symbol
converts a “on_String” => :String.
Instance Method Details
#on_format?(str) ⇒ TrueClass || FalseClass
does the string passed in start with ‘on_’
36 37 38 |
# File 'lib/vigilem/core/event_handler.rb', line 36 def on_format?(str) str.start_with?('on_') end |
#respond_to?(sym, include_all = false) ⇒ TrueClass || FalseClass
29 30 31 |
# File 'lib/vigilem/core/event_handler.rb', line 29 def respond_to?(sym, include_all=false) on_format?(sym.to_s) || super(sym, include_all) end |
#snakecase_class_name(namespace) ⇒ String
22 23 24 |
# File 'lib/vigilem/core/event_handler.rb', line 22 def snakecase_class_name(namespace) namespace.to_s.split('::').last.snakecase end |
#type_from_on_format(on_name) ⇒ Symbol
converts a “on_String” => :String
43 44 45 |
# File 'lib/vigilem/core/event_handler.rb', line 43 def type_from_on_format(on_name) on_name.split('on_', 2).last.to_sym end |