Permalink
Browse files

Fix bug setting context from :context or :name options to Query#initi…

…alize.
  • Loading branch information...
1 parent b9aa1e4 commit 0cdefd772936f1de31cd7e6b74ac5bba1aaf009a @gkellogg gkellogg committed Mar 19, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/rdf/query.rb
View
@@ -161,7 +161,9 @@ def initialize(*patterns, &block)
patterns << @options if patterns.empty?
@variables = {}
@solutions = @options.delete(:solutions) || Solutions.new
- context = @options.delete(:context) || @options.delete(:name)
+ context = @options.fetch(:context, @options.fetch(:name, nil))
+ @options.delete(:context)
+ @options.delete(:name)
@patterns = case patterns.first
when Hash then compile_hash_patterns(HashPatternNormalizer.normalize!(patterns.first.dup, @options))

0 comments on commit 0cdefd7

Please sign in to comment.