Class: Export

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::AttributeAssignment
Defined in:
app/models/export.rb

Overview

An export is a means of generating a file for export, usually CSV containing data about the plate.

Constant Summary collapse

NotFound =

Raise if there is an attempt to find a non-existent model

Class.new(StandardError)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Export

Returns a new instance of Export.



34
35
36
# File 'app/models/export.rb', line 34

def initialize(args = {})
  assign_attributes(args)
end

Instance Attribute Details

#ancestor_purposeObject

Returns the value of attribute ancestor_purpose.



24
25
26
# File 'app/models/export.rb', line 24

def ancestor_purpose
  @ancestor_purpose
end

#ancestor_tube_purposeObject

Returns the value of attribute ancestor_tube_purpose.



24
25
26
# File 'app/models/export.rb', line 24

def ancestor_tube_purpose
  @ancestor_tube_purpose
end

#csvObject

Returns the value of attribute csv.



24
25
26
# File 'app/models/export.rb', line 24

def csv
  @csv
end

#file_extensionObject

Returns the value of attribute file_extension.



24
25
26
# File 'app/models/export.rb', line 24

def file_extension
  @file_extension
end

#filenameObject

Returns the value of attribute filename.



24
25
26
# File 'app/models/export.rb', line 24

def filename
  @filename
end

#plate_includesObject

Returns the value of attribute plate_includes.



24
25
26
# File 'app/models/export.rb', line 24

def plate_includes
  @plate_includes
end

#tube_includesObject

Returns the value of attribute tube_includes.



24
25
26
# File 'app/models/export.rb', line 24

def tube_includes
  @tube_includes
end

#tube_selectsObject

Returns the value of attribute tube_selects.



24
25
26
# File 'app/models/export.rb', line 24

def tube_selects
  @tube_selects
end

#workflowObject

Returns the value of attribute workflow.



24
25
26
# File 'app/models/export.rb', line 24

def workflow
  @workflow
end

Class Method Details

.find(id) ⇒ Object



18
19
20
21
# File 'app/models/export.rb', line 18

def find(id)
  attributes = loader.config.fetch(id) { raise NotFound, "Could not find export #{id}" }
  Export.new(attributes)
end

.loaderObject



14
15
16
# File 'app/models/export.rb', line 14

def loader
  @loader ||= ConfigLoader::ExportsLoader.new
end