I dont know the correct terminology for what i am asking I tried to google it and couldnt ind anything for the same reason
I am writing a ruby library, and i want to rewite the functions so they work as below as i prefer it for readability (inside a block?)
at the moment i have a function that does this
@dwg = Dwg.new("test.dwg")
@dwg.line([0,0,0],[1,1,0])
@dwg.save
i want to rewrite it so it works like this
Dwg.new("test.dwg") do
line([0,0,0],[1,1,0])
save
end
can you outline the way i go about this please