I have the an instance method of the class Schedule:
However, I would like one of the methods create_recurring to create an object of class Orchestrate.
The reason why is that I wanted all classes of Orchestrate to be what creates something in the actual database. That class has all the methods to actually create something.
So it looks like this:
def create_recurring
orchestrate = OrchestrateIo.new(@bot_client_id, :profiles)
end
However, when writing my rspec, I had no idea how to actually test for the creation of another object, which made me think I was going about it all wrong.
questions: 1) Is this doable/allowable? 2) If yes, how would I test for the creation of a new instance of another Class? 3) What's the right way to do it if this approach is wrong?
OrchestrateIoby sending the messagenewtoOrchestrateIo). Also, all methods in Ruby are instance methods, there is no other kind of method. Now, since all methods are instance methods, and creating objects is (half of) all you do in Ruby, it would be extremely stupid, if …OrchestrateIo, and one instance ofSymbol(:profiles). The latter demonstrates another of creating objects: literals.