Module: Tins::AskAndSend
- Included in:
- Object
- Defined in:
- lib/tins/ask_and_send.rb
Instance Method Summary collapse
- #ask_and_send(method_name, *args, &block) ⇒ Object
- #ask_and_send!(method_name, *args, &block) ⇒ Object
Instance Method Details
#ask_and_send(method_name, *args, &block) ⇒ Object
3 4 5 6 7 |
# File 'lib/tins/ask_and_send.rb', line 3 def ask_and_send(method_name, *args, &block) if respond_to?(method_name) __send__(method_name, *args, &block) end end |
#ask_and_send!(method_name, *args, &block) ⇒ Object
9 10 11 12 13 |
# File 'lib/tins/ask_and_send.rb', line 9 def ask_and_send!(method_name, *args, &block) if respond_to?(method_name, true) __send__(method_name, *args, &block) end end |