Skip to content

Commit

Permalink
Fix bug setting context from :context or :name options to Query#initi…
Browse files Browse the repository at this point in the history
…alize.
  • Loading branch information
gkellogg committed Mar 19, 2013
1 parent b9aa1e4 commit 0cdefd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rdf/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 0cdefd7

Please sign in to comment.