Module: CoreExtensions::Object

Defined in:
lib/core_extensions/object.rb

Instance Method Summary collapse

Instance Method Details

#send_with_default(method, default = nil, *args) ⇒ Object



3
4
5
# File 'lib/core_extensions/object.rb', line 3

def send_with_default(method, default = nil, *args)
  !self.nil? && self.respond_to?(method) ? self.send(*args.unshift(method)) : default
end