Class: EtnaApp::Magma::Models::Attributes::UpdateFromCsv

Inherits:
Etna::Command
  • Object
show all
Includes:
WithEtnaClients, WithLogger
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from Etna::Command

#parent

Instance Method Summary collapse

Methods included from WithLogger

#logger

Methods included from WithEtnaClients

#environment, #exit, exit, #janus_client, #magma_client, #metis_client, #polyphemus_client, #token

Methods inherited from Etna::Command

#completions, #fill_in_missing_params, #find_command, #initialize, parent_scope, #setup

Methods included from Etna::CommandOrExecutor

#command_name, #completions_for, #desc, #flag_argspec, #flag_as_parameter, included, #parse_flags, #program_name, #usage

Constructor Details

This class inherits a constructor from Etna::Command

Instance Method Details

#execute(project_name, model_name, filepath, hole_value: '_', json_values: false) ⇒ Object



462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/commands.rb', line 462

def execute(project_name, model_name, filepath, hole_value: '_', json_values: false)
  @project_name = project_name

  update_attributes_workflow = Etna::Clients::Magma::UpdateAttributesFromCsvWorkflowSingleModel.new(
      magma_crud: magma_crud,
      project_name: project_name,
      model_name: model_name,
      filepath: filepath,
      hole_value: hole_value,
      json_values: json_values)
  update_attributes_workflow.update_attributes
end

#magma_crudObject



456
457
458
459
460
# File 'lib/commands.rb', line 456

def magma_crud
  @magma_crud ||= Etna::Clients::Magma::MagmaCrudWorkflow.new(
      magma_client: magma_client,
      project_name: @project_name)
end