Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from anonymous/QueryRepository.rb
Created June 6, 2016 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radar/d2f931b51a7231e5cc1d22550a117eef to your computer and use it in GitHub Desktop.
Save radar/d2f931b51a7231e5cc1d22550a117eef to your computer and use it in GitHub Desktop.
class QueryRepository
def initialize
@queries = {
"Do a query" => "Some Query",
"Do a random query" => "Random Query",
"I want rowid 10" => "Query Random Table for rowid 23",
"Eff off" => "This does nothing"
}
end
def get_labels
@queries.keys
end
def valid_key?(key)
@queries.key?(key)
end
def get_query(key)
@queries.key?(key) ? @queries[key] : nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment