Class: RdfaParser::Literal::Null

Inherits:
Encoding
  • Object
show all
Defined in:
lib/rdfa_parser/literal.rb

Constant Summary

Constants inherited from Encoding

Encoding::MAP

Instance Attribute Summary

Attributes inherited from Encoding

#value

Instance Method Summary collapse

Methods inherited from Encoding

#==, coerce, #compare_contents, #encode_contents, #escape, float, #hash, #initialize, integer, #should_quote?, string, the_null_encoding, #unescape, xmlliteral

Constructor Details

This class inherits a constructor from RdfaParser::Literal::Encoding

Instance Method Details

#format_as_n3(content, lang) ⇒ Object



204
205
206
207
# File 'lib/rdfa_parser/literal.rb', line 204

def format_as_n3(content, lang)
  "\"#{escape(content)}\"" + (lang ? "@#{lang}" : "")
  # Perform translation on value if it's typed
end

#format_as_trix(content, lang) ⇒ Object



209
210
211
212
213
214
215
# File 'lib/rdfa_parser/literal.rb', line 209

def format_as_trix(content, lang)
  if lang
    "<plainLiteral xml:lang=\"#{lang}\"\>#{content}</plainLiteral>"
  else
    "<plainLiteral>#{content}</plainLiteral>"
  end
end

#inspectObject



223
224
225
# File 'lib/rdfa_parser/literal.rb', line 223

def inspect
  "<theReddy::TypeLiteral::Encoding::Null>"
end

#to_sObject



200
201
202
# File 'lib/rdfa_parser/literal.rb', line 200

def to_s
  ''
end

#xml_args(content, lang) ⇒ Object



217
218
219
220
221
# File 'lib/rdfa_parser/literal.rb', line 217

def xml_args(content, lang)
  hash = {}
  hash["xml:lang"] = lang if lang
  [content, hash]
end

#xmlliteral?Boolean

Returns:

  • (Boolean)


227
228
229
# File 'lib/rdfa_parser/literal.rb', line 227

def xmlliteral?
  false
end