Class: Rialto::Etl::Transformers::StanfordOrganizationsToVivo

Inherits:
Object
  • Object
show all
Defined in:
lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb

Overview

Transformer turning Stanford org info into Vivo format

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input:) ⇒ StanfordOrganizationsToVivo

Initialize a new instance of the transformer

Parameters:

  • input (String)

    valid file path



16
17
18
# File 'lib/rialto/etl/transformers/stanford_organizations_to_vivo.rb', line 16

def initialize(input:)
  @input = input
end

Instance Attribute Details

#inputObject (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

#transformObject

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