E
Erik Terpstra
I have an array 'conds', which contains some sub-expressions for an
xpath query:
conds = ["@title='Foo'", "@edition='Bar'", "@date='20040513'"]
Is there an existing library that lets me construct all possible
combinations like this?
puts conds.<some Array extension method>.collect{|n| n.join ' and '}
which produces:
@title='Foo' and @edition='Bar' and @date='20040513'
@title='Foo' and @edition='Bar'
@title='Foo' and @date='20040513'
@edition='Bar' and @date='20040513'
@title='Foo'
@edition='Bar'
@date='20040513'
xpath query:
conds = ["@title='Foo'", "@edition='Bar'", "@date='20040513'"]
Is there an existing library that lets me construct all possible
combinations like this?
puts conds.<some Array extension method>.collect{|n| n.join ' and '}
which produces:
@title='Foo' and @edition='Bar' and @date='20040513'
@title='Foo' and @edition='Bar'
@title='Foo' and @date='20040513'
@edition='Bar' and @date='20040513'
@title='Foo'
@edition='Bar'
@date='20040513'