Class: JSON::LD::API::RemoteDocument
- Inherits:
-
Object
- Object
- JSON::LD::API::RemoteDocument
- Defined in:
- lib/json/ld/api.rb
Overview
A RemoteDocument is returned from a documentLoader.
Instance Attribute Summary collapse
-
#contextUrl ⇒ String
The URL of a remote context as specified by an HTTP Link header with rel=‘www.w3.org/ns/json-ld#context`.
-
#document ⇒ String, ...
readonly
The retrieved document, either as raw text or parsed JSON.
-
#documentUrl ⇒ String
readonly
URL of the loaded document, after redirects.
Instance Method Summary collapse
-
#initialize(url, document, context_url = nil) ⇒ RemoteDocument
constructor
A new instance of RemoteDocument.
Constructor Details
#initialize(url, document, context_url = nil) ⇒ RemoteDocument
Returns a new instance of RemoteDocument.
587 588 589 590 591 |
# File 'lib/json/ld/api.rb', line 587 def initialize(url, document, context_url = nil) @documentUrl = url @document = document @contextUrl = context_url end |
Instance Attribute Details
#contextUrl ⇒ String
Returns The URL of a remote context as specified by an HTTP Link header with rel=‘www.w3.org/ns/json-ld#context`.
580 581 582 |
# File 'lib/json/ld/api.rb', line 580 def contextUrl @contextUrl end |
#document ⇒ String, ... (readonly)
Returns The retrieved document, either as raw text or parsed JSON.
576 577 578 |
# File 'lib/json/ld/api.rb', line 576 def document @document end |
#documentUrl ⇒ String (readonly)
Returns URL of the loaded document, after redirects.
572 573 574 |
# File 'lib/json/ld/api.rb', line 572 def documentUrl @documentUrl end |