G
Gavri Fernandez
Hi everyone,
I want to create a query based on options passed in through
an options hash to my method.
The query would look like
"title:ruby and author:dave and publisherreilly"
or
"title:ruby and publisher:addison-wesley"
or
"author:dave"
or some other combination based on what options have been set in the hash.
options[:author] |= "" followed by Array#join doesn't help me
because it would lead to successive 'and's in the query.
What is the Ruby Idiom to achieve what I want?
TIA
I want to create a query based on options passed in through
an options hash to my method.
The query would look like
"title:ruby and author:dave and publisherreilly"
or
"title:ruby and publisher:addison-wesley"
or
"author:dave"
or some other combination based on what options have been set in the hash.
options[:author] |= "" followed by Array#join doesn't help me
because it would lead to successive 'and's in the query.
What is the Ruby Idiom to achieve what I want?
TIA