Class: DataFoodConsortium::Connector::Connector
- Inherits:
-
Object
- Object
- DataFoodConsortium::Connector::Connector
- Includes:
- Singleton
- Defined in:
- lib/datafoodconsortium/connector/connector.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#FACETS ⇒ Object
readonly
Returns the value of attribute FACETS.
-
#MEASURES ⇒ Object
readonly
Returns the value of attribute MEASURES.
-
#PRODUCT_TYPES ⇒ Object
readonly
Returns the value of attribute PRODUCT_TYPES.
Instance Method Summary collapse
- #export(subject, *subjects) ⇒ Object
- #import(json_string_or_io) ⇒ Object
- #loadFacets(data) ⇒ Object
- #loadMeasures(data) ⇒ Object
- #loadProductTypes(data) ⇒ Object
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
32 33 34 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 32 def context @context end |
#FACETS ⇒ Object (readonly)
Returns the value of attribute FACETS.
34 35 36 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 34 def FACETS @FACETS end |
#MEASURES ⇒ Object (readonly)
Returns the value of attribute MEASURES.
35 36 37 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 35 def MEASURES @MEASURES end |
#PRODUCT_TYPES ⇒ Object (readonly)
Returns the value of attribute PRODUCT_TYPES.
36 37 38 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 36 def PRODUCT_TYPES @PRODUCT_TYPES end |
Instance Method Details
#export(subject, *subjects) ⇒ Object
38 39 40 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 38 def export(subject, *subjects) return @exporter.process(subject, *subjects) end |
#import(json_string_or_io) ⇒ Object
42 43 44 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 42 def import(json_string_or_io) Importer.new.import(json_string_or_io) end |
#loadFacets(data) ⇒ Object
46 47 48 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 46 def loadFacets(data) @FACETS = loadThesaurus(data) end |
#loadMeasures(data) ⇒ Object
50 51 52 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 50 def loadMeasures(data) @MEASURES = loadThesaurus(data) end |
#loadProductTypes(data) ⇒ Object
54 55 56 |
# File 'lib/datafoodconsortium/connector/connector.rb', line 54 def loadProductTypes(data) @PRODUCT_TYPES = loadThesaurus(data) end |