Class: YAML_LD::Format
- Inherits:
-
RDF::Format
- Object
- RDF::Format
- YAML_LD::Format
- Defined in:
- lib/yaml_ld/format.rb
Overview
YAML-LD format specification.
Class Method Summary collapse
-
.detect(sample) ⇒ Boolean
Sample detection to see if it matches YAML-LD.
-
.name ⇒ Object
Override normal format name.
-
.to_sym ⇒ Object
Override normal symbol generation.
Class Method Details
.detect(sample) ⇒ Boolean
Sample detection to see if it matches YAML-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.
40 41 42 |
# File 'lib/yaml_ld/format.rb', line 40 def self.detect(sample) !!sample.match(/---/m) end |
.name ⇒ Object
Override normal format name
52 53 54 |
# File 'lib/yaml_ld/format.rb', line 52 def self.name "YAML-LD" end |
.to_sym ⇒ Object
Override normal symbol generation
46 47 48 |
# File 'lib/yaml_ld/format.rb', line 46 def self.to_sym :yamlld end |