I want to achieve something like this:
object = SomeObj.new do
instancevar = "value"
anotherone = "valuenew"
end
object.instancevar => "value"
But I have no idea how to design initialize method, I had something like this:
class Klass
def initialize(info = {})
info[:property] = "value"
end
end
I want to pass some hash in constructor to set instance variables, but also I would like to provide instantiating with block, but have no idea how to achieve this.