Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed so tests don't report constants warning

  • Loading branch information...
commit cc97d79044c1f334ec3c69e744095413a29f89d1 1 parent 64b29cf
@tommorris authored
Showing with 7 additions and 10 deletions.
  1. +2 −0  .autotest
  2. +5 −10 lib/rena/literal.rb
View
2  .autotest
@@ -0,0 +1,2 @@
+require 'autotest/growl'
+require 'autotest/redgreen'
View
15 lib/rena/literal.rb
@@ -88,21 +88,16 @@ def to_trix
class TypedLiteral < Literal
class Encoding
- LITERAL_ENCODING = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
- INTEGER_ENCODING = "http://www.w3.org/2001/XMLSchema#int"
- FLOAT_ENCODING = "http://www.w3.org/2001/XMLSchema#float"
- STRING_ENCODING = "http://www.w3.org/2001/XMLSchema#string"
-
def self.integer
- @integer ||= coerce INTEGER_ENCODING
+ @integer ||= coerce "http://www.w3.org/2001/XMLSchema#int"
end
def self.float
- @float ||= coerce FLOAT_ENCODING
+ @float ||= coerce "http://www.w3.org/2001/XMLSchema#float"
end
def self.string
- @string ||= coerce STRING_ENCODING
+ @string ||= coerce "http://www.w3.org/2001/XMLSchema#string"
end
def self.coerce(string_or_nil)
@@ -147,7 +142,7 @@ def initialize(url)
end
def should_quote?
- @url != INTEGER_ENCODING
+ @url != self.class.integer.to_s
end
def ==(other)
@@ -180,7 +175,7 @@ def format_as_trix(value)
end
def xmlliteral?
- @url == LITERAL_ENCODING
+ @url == "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.