Method: Invoicing::ClassInfo::Base#get

Defined in:
lib/invoicing/class_info.rb

#get(object, method_name) ⇒ Object

Returns the value returned by calling method_name (renamed through options using method) on object. Returns nil if object is nil or object does not respond to that method.



175
176
177
178
# File 'lib/invoicing/class_info.rb', line 175

def get(object, method_name)
  meth = method(method_name)
  (object.nil? || !object.respond_to?(meth)) ? nil : object.send(meth)
end