Skip to content

Commit 8ec503e

Browse files
committed
Improve Literal#inspect for built-in datatype.
1 parent 4fee46e commit 8ec503e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/rdf/spec/inspects.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
class RDF::Literal
55
def inspect
6-
"\"#{escape(value)}\"#{('@' + self.language.to_s) if self.language?} R:L:(#{self.class.to_s.match(/([^:]*)$/)})"
6+
klass = self.class.to_s.match(/([^:]*)$/).to_s
7+
dt = self.datatype
8+
"\"#{escape(value)}\"#{('@' + self.language.to_s) if self.language?} R:L:(#{klass == 'Literal' && dt ? dt : klass})"
79
end
810
end
911

0 commit comments

Comments
 (0)