Permalink
Browse files

Implemented Value#term? and Term#term?. Added Value#variable? to repl…

…ace Resource#variable?
  • Loading branch information...
1 parent e0ccf20 commit a76efbdd7f69218adc2bc49271584c2f491666a1 @gkellogg gkellogg committed Mar 20, 2013
Showing with 25 additions and 9 deletions.
  1. +4 −5 lib/rdf/model/term.rb
  2. +21 −4 lib/rdf/model/value.rb
View
@@ -66,12 +66,11 @@ def constant?
end
##
- # Returns `true` if this term is variable.
+ # Returns `true` if `self` is a {RDF::Term}.
#
- # @return [Boolean] `true` or `false`
- # @see #constant?
- def variable?
- false
+ # @return [Boolean]
+ def term?
+ true
end
end # Term
end # RDF
View
@@ -53,18 +53,27 @@ def list?
end
##
- # Returns `true` if `self` is a {RDF::Literal}.
+ # Returns `true` if `self` is a {RDF::Term}.
#
# @return [Boolean]
- def literal?
+ def term?
false
end
##
- # Returns `true` if `self` is a {RDF::Node}.
+ # Returns `true` if this term is variable.
+ #
+ # @return [Boolean] `true` or `false`
+ # @see #constant?
+ def variable?
+ false
+ end
+
+ ##
+ # Returns `true` if `self` is a {RDF::Literal}.
#
# @return [Boolean]
- def node?
+ def literal?
false
end
@@ -77,6 +86,14 @@ def resource?
end
##
+ # Returns `true` if `self` is a {RDF::Node}.
+ #
+ # @return [Boolean]
+ def node?
+ false
+ end
+
+ ##
# Returns `true` if `self` is an IRI reference.
#
# By default this is simply an alias for {RDF::Value#uri?}.

0 comments on commit a76efbd

Please sign in to comment.