Class: IqRdf::Literal::URI
- Inherits:
-
IqRdf::Literal
- Object
- IqRdf::Literal
- IqRdf::Literal::URI
- Defined in:
- lib/iq_rdf/literal/uri.rb
Instance Method Summary collapse
- #build_xml(xml, &block) ⇒ Object
-
#initialize(uri) ⇒ URI
constructor
A new instance of URI.
- #to_ntriples(parent_lang = nil) ⇒ Object
- #to_s(options = {}) ⇒ Object
Methods inherited from IqRdf::Literal
Constructor Details
#initialize(uri) ⇒ URI
Returns a new instance of URI.
5 6 7 8 |
# File 'lib/iq_rdf/literal/uri.rb', line 5 def initialize(uri) raise "#{uri.inspect} is not an URI" unless uri.is_a?(::URI) super(uri) end |
Instance Method Details
#build_xml(xml, &block) ⇒ Object
18 19 20 |
# File 'lib/iq_rdf/literal/uri.rb', line 18 def build_xml(xml, &block) block.call("rdf:resource" => @obj.to_s) end |
#to_ntriples(parent_lang = nil) ⇒ Object
14 15 16 |
# File 'lib/iq_rdf/literal/uri.rb', line 14 def to_ntriples(parent_lang = nil) "<#{@obj.to_s}>" end |
#to_s(options = {}) ⇒ Object
10 11 12 |
# File 'lib/iq_rdf/literal/uri.rb', line 10 def to_s( = {}) "<#{@obj.to_s}>" end |