Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/marley/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#send_or_default(meth, default) ⇒ Object
2 3 4 |
# File 'lib/marley/core_ext.rb', line 2 def send_or_default(meth, default) respond_to?(meth) ? send(meth) : default end |
#send_or_nil(meth) ⇒ Object
5 6 7 |
# File 'lib/marley/core_ext.rb', line 5 def send_or_nil(meth) send_or_default(meth,nil) end |