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
-
#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=‘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.
816 817 818 819 820 821 822 |
# File 'lib/json/ld/api.rb', line 816 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.
792 793 794 |
# File 'lib/json/ld/api.rb', line 792 def contentType @contentType end |
#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`.
796 797 798 |
# File 'lib/json/ld/api.rb', line 796 def contextUrl @contextUrl end |
#document ⇒ Array<Hash>, Hash
The parsed retrieved document.
800 801 802 |
# File 'lib/json/ld/api.rb', line 800 def document @document end |
#documentUrl ⇒ String
The final URL of the loaded document. This is important to handle HTTP redirects properly.
788 789 790 |
# File 'lib/json/ld/api.rb', line 788 def documentUrl @documentUrl end |
#profile ⇒ String
The value of any profile parameter retrieved as part of the original contentType.
804 805 806 |
# File 'lib/json/ld/api.rb', line 804 def profile @profile end |