This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def using(to_ensure) | |
begin | |
yield if block_given? | |
ensure | |
to_ensure() | |
end | |
obj = SomthingToClose.connect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LineBuilder | |
{ | |
List<LineItem> _lines; | |
public LineBuilder WithLine(params string[] names) | |
{ | |
_lines.AddRange(names.Select(name => new LineItem(name))); | |
return this; | |
} |