Class: Rialto::Etl::Transformers::StanfordOrganizationsToVivo
- Inherits:
-
Object
- Object
- Rialto::Etl::Transformers::StanfordOrganizationsToVivo
- Defined in:
- lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb
Overview
Transformer turning Stanford org info into Vivo format
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
A valid file path.
Instance Method Summary collapse
-
#initialize(input:) ⇒ StanfordOrganizationsToVivo
constructor
Initialize a new instance of the transformer.
-
#transform ⇒ Object
Transform a stream into a new representation, using Traject.
Constructor Details
#initialize(input:) ⇒ StanfordOrganizationsToVivo
Initialize a new instance of the transformer
16 17 18 |
# File 'lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb', line 16 def initialize(input:) @input = input end |
Instance Attribute Details
#input ⇒ Object (readonly)
A valid file path
11 12 13 |
# File 'lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb', line 11 def input @input end |
Instance Method Details
#transform ⇒ Object
Transform a stream into a new representation, using Traject
21 22 23 24 25 |
# File 'lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb', line 21 def transform File.open(input, 'r') do |stream| transformer.process(stream) end end |