Class: JSON::LD::Format
- Inherits:
-
RDF::Format
- Object
- RDF::Format
- JSON::LD::Format
- Defined in:
- lib/json/ld/format.rb
Overview
RDFa format specification.
Class Method Summary collapse
-
.detect(sample) ⇒ Boolean
Sample detection to see if it matches JSON-LD.
-
.to_sym ⇒ Object
Override normal symbol generation.
Class Method Details
.detect(sample) ⇒ Boolean
Sample detection to see if it matches JSON-LD
Use a text sample to detect the format of an input file. Sub-classes implement a matcher sufficient to detect probably format matches, including disambiguating between other similar formats.
41 42 43 |
# File 'lib/json/ld/format.rb', line 41 def self.detect(sample) !!sample.match(/\{\s*"@(id|context|type)"/m) end |
.to_sym ⇒ Object
Override normal symbol generation
47 48 49 |
# File 'lib/json/ld/format.rb', line 47 def self.to_sym :jsonld end |