Skip to content
Browse files

Implemented RDF::Value#variable?.

  • Loading branch information...
1 parent e5ae590 commit 3a71fe8fe1f375c285a2a5efa6d506f1d02b2321 @bendiken committed Apr 16, 2010
Showing with 17 additions and 0 deletions.
  1. +8 −0 lib/rdf/model/value.rb
  2. +9 −0 lib/rdf/query/variable.rb
View
8 lib/rdf/model/value.rb
@@ -80,6 +80,14 @@ def uri?
alias_method :iri?, :uri?
##
+ # Returns `true` if this value is a query variable.
+ #
+ # @return [Boolean]
+ def variable?
+ false
+ end
+
+ ##
# Compares this value to `other` for sorting purposes.
#
# Subclasses should override this to provide a more meaningful
View
9 lib/rdf/query/variable.rb
@@ -55,6 +55,15 @@ def initialize(name, value = nil)
end
##
+ # Returns `true`.
+ #
+ # @return [Boolean]
+ # @see RDF::Value#variable?
+ def variable?
+ true
+ end
+
+ ##
# Returns `true` if this variable has a name.
#
# @return [Boolean]

0 comments on commit 3a71fe8

Please sign in to comment.
Something went wrong with that request. Please try again.