Class: JSON::LD::API::RemoteDocument
- Defined in:
- vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/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.
925 926 927 928 929 930 931 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 925 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.
901 902 903 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 901 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
.
905 906 907 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 905 def contextUrl @contextUrl end |
#document ⇒ Array<Hash>, Hash
The parsed retrieved document.
909 910 911 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 909 def document @document end |
#documentUrl ⇒ String
The final URL of the loaded document. This is important to handle HTTP redirects properly.
897 898 899 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 897 def documentUrl @documentUrl end |
#profile ⇒ String
The value of any profile parameter retrieved as part of the original contentType.
913 914 915 |
# File 'vendor/bundler/ruby/3.2.0/bundler/gems/json-ld-cb5ef847d963/lib/json/ld/api.rb', line 913 def profile @profile end |