This is a hard one to search for, but I've got a line of Ruby in a class method where a variable is first declared by assigning it a bare new keyword and I'm not exactly sure what's going on here:
def self.html_render_controller(post)
controller = new
controller.action = 'show'
controller.post = post
controller.render_to_string
end
Coming from other languages, it looks to me like controller is implicitly being initialized as an object of some kind. And render_to_string is a Rails built-in, so my best guess is controller is initialized as some kind of Rails object?
I guess my question is really what is the value of controller after that first assignment? Or what kind of execution rules or even just documentation in Ruby would point me in the right direction for understanding this kind of shorthand?