Class: JSON::LD::API::RemoteDocument
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb
Overview
A RemoteDocument is returned from a documentLoader.
Instance Attribute Summary collapse
-
#contentType ⇒ String
readonly
The Content-Type of the loaded document, exclusive of any optional parameters.
-
#contextUrl ⇒ String
The URL of a remote context as specified by an HTTP Link header with rel=
http://www.w3.org/ns/json-ld#context
. -
#document ⇒ Array<Hash>, Hash
The parsed retrieved document.
-
#documentUrl ⇒ String
The final URL of the loaded document.
-
#profile ⇒ String
The value of any profile parameter retrieved as part of the original contentType.
Instance Method Summary collapse
-
#initialize(document, documentUrl: nil, contentType: nil, contextUrl: nil, profile: nil, **options) ⇒ RemoteDocument
constructor
A new instance of RemoteDocument.
Constructor Details
#initialize(document, documentUrl: nil, contentType: nil, contextUrl: nil, profile: nil, **options) ⇒ RemoteDocument
Returns a new instance of RemoteDocument.
953 954 955 956 957 958 959 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 953 def initialize(document, documentUrl: nil, contentType: nil, contextUrl: nil, profile: nil, **) @document = document @documentUrl = documentUrl || [:base_uri] @contentType = contentType || [:content_type] @contextUrl = contextUrl @profile = profile end |
Instance Attribute Details
#contentType ⇒ String (readonly)
The Content-Type of the loaded document, exclusive of any optional parameters.
929 930 931 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 929 def contentType @contentType end |
#contextUrl ⇒ String
Returns The URL of a remote context as specified by an HTTP Link header with rel=http://www.w3.org/ns/json-ld#context
.
933 934 935 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 933 def contextUrl @contextUrl end |
#document ⇒ Array<Hash>, Hash
The parsed retrieved document.
937 938 939 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 937 def document @document end |
#documentUrl ⇒ String
The final URL of the loaded document. This is important to handle HTTP redirects properly.
925 926 927 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 925 def documentUrl @documentUrl end |
#profile ⇒ String
The value of any profile parameter retrieved as part of the original contentType.
941 942 943 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/json-ld-f1de87658826/lib/json/ld/api.rb', line 941 def profile @profile end |