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.
555 556 557 558 559 |
# File 'lib/json/ld/api.rb', line 555 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`.
548 549 550 |
# File 'lib/json/ld/api.rb', line 548 def contextUrl @contextUrl end |
#document ⇒ String, ... (readonly)
Returns The retrieved document, either as raw text or parsed JSON.
544 545 546 |
# File 'lib/json/ld/api.rb', line 544 def document @document end |
#documentUrl ⇒ String (readonly)
Returns URL of the loaded document, after redirects.
540 541 542 |
# File 'lib/json/ld/api.rb', line 540 def documentUrl @documentUrl end |