KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a situation where i need to call something like this : class Office attr_accessor :workers, :id def initialize @workers = [] end def workers<<(worker) type = worker.type resp = Organiation::Worker.post("/office/#{@id}/workers.json", :worker => {:type => type}) end end this is where i need to call office = Office.new() new_worker = Worker.new() office.workers << new_worker how should i modify the above workers method in order to implement above code.
Tags (comma-separated)
Save Edits
Cancel