Class: DataFoodConsortium::Connector::Context
- Inherits:
-
JSON::LD::Context
- Object
- JSON::LD::Context
- DataFoodConsortium::Connector::Context
- Defined in:
- lib/datafoodconsortium/connector/context.rb
Overview
Preload the DFC context.
Similar to: github.com/ruby-rdf/json-ld-preloaded/
Constant Summary collapse
- URL =
"https://www.datafoodconsortium.org"
Class Method Summary collapse
-
.inputContext ⇒ Object
The hash serializer expects only string values in the context.
- .json ⇒ Object
Class Method Details
.inputContext ⇒ Object
The hash serializer expects only string values in the context.
32 33 34 |
# File 'lib/datafoodconsortium/connector/context.rb', line 32 def self.inputContext @inputContext = json.select { |key, value| value.is_a? String } end |
.json ⇒ Object
36 37 38 |
# File 'lib/datafoodconsortium/connector/context.rb', line 36 def self.json @json ||= JSON.parse(File.read("#{__dir__}/context_2.0.0.json"))["@context"] end |