Can I call a referring class in a service object?

43 Views Asked by At

I have a service object called from many different classes. Is there a way to call the referring class without passing it like this?

class Document
  ServiceObject.new('Document', id)
end

Can I refer to self or super or something in ServiceObject?

1

There are 1 best solutions below

1
On BEST ANSWER

I don't think you can do it natively, but there is a gem for it according to sender class in ruby?