lib/rdf/query/solution.rb in rdf-0.3.0.pre vs lib/rdf/query/solution.rb in rdf-0.3.0
- old
+ new
@@ -29,11 +29,11 @@
include Enumerable
##
# Initializes the query solution.
#
- # @param [Hash{Symbol => RDF::Value}] bindings
+ # @param [Hash{Symbol => RDF::Term}] bindings
# @yield [solution]
def initialize(bindings = {}, &block)
@bindings = bindings.to_hash
if block_given?
@@ -50,11 +50,11 @@
##
# Enumerates over every variable binding in this solution.
#
# @yield [name, value]
# @yieldparam [Symbol] name
- # @yieldparam [RDF::Value] value
+ # @yieldparam [RDF::Term] value
# @return [Enumerator]
def each_binding(&block)
@bindings.each(&block)
end
alias_method :each, :each_binding
@@ -72,11 +72,11 @@
##
# Enumerates over every variable value in this solution.
#
# @yield [value]
- # @yieldparam [RDF::Value] value
+ # @yieldparam [RDF::Term] value
# @return [Enumerator]
def each_value(&block)
@bindings.each_value(&block)
end
@@ -127,22 +127,22 @@
##
# Returns the value of the variable `name`.
#
# @param [Symbol, #to_sym] name
# the variable name
- # @return [RDF::Value]
+ # @return [RDF::Term]
def [](name)
@bindings[name.to_sym]
end
##
# Binds or rebinds the variable `name` to the given `value`.
#
# @param [Symbol, #to_sym] name
# the variable name
- # @param [RDF::Value] value
- # @return [RDF::Value]
+ # @param [RDF::Term] value
+ # @return [RDF::Term]
# @since 0.3.0
def []=(name, value)
@bindings[name.to_sym] = value
end
@@ -170,17 +170,17 @@
def merge(other)
self.class.new(@bindings.dup).merge!(other)
end
##
- # @return [Array<Array(Symbol, RDF::Value)>}
+ # @return [Array<Array(Symbol, RDF::Term)>}
def to_a
@bindings.to_a
end
##
- # @return [Hash{Symbol => RDF::Value}}
+ # @return [Hash{Symbol => RDF::Term}}
def to_hash
@bindings.dup
end
##
@@ -191,10 +191,10 @@
protected
##
# @param [Symbol] name
- # @return [RDF::Value]
+ # @return [RDF::Term]
def method_missing(name, *args, &block)
if args.empty? && @bindings.has_key?(name.to_sym)
@bindings[name.to_sym]
else
super # raises NoMethodError