Class: GECS::BagOfHolding

Inherits:
Struct
  • Object
show all
Defined in:
lib/GECS.rb

Overview

Normative struct definition.

BagOfHolding is a bag containing everything that is loaded from or saved to an export file except for the GECS version number.

parms

Array of strings defining pseudo-enum as used in a given data file. See Parms.

estMethods

Array of strings defining pseudo-enum as used in a given data file. See EstMethods.

estMethodParms

Array of strings defining pseudo-enum as used in a given data file. See EstMethodParms.

invTypes

Array of strings defining pseudo-enum as used in a given data file. See InvTypes.

parmDefs

Array of ParmDef structs defining pseudo-enum as used in a given data file.

experiments

Array of Experiment structs (index by experiment id).

data

Hash from Key to array (per depVars) of arrays (measurement values in chronological order).

ests

Hash from Key to array (per depVars) of hashes (from parmDefs index to ParmData).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



227
228
229
# File 'lib/GECS.rb', line 227

def data
  @data
end

#estMethodParmsObject

Returns the value of attribute estMethodParms

Returns:

  • (Object)

    the current value of estMethodParms



227
228
229
# File 'lib/GECS.rb', line 227

def estMethodParms
  @estMethodParms
end

#estMethodsObject

Returns the value of attribute estMethods

Returns:

  • (Object)

    the current value of estMethods



227
228
229
# File 'lib/GECS.rb', line 227

def estMethods
  @estMethods
end

#estsObject

Returns the value of attribute ests

Returns:

  • (Object)

    the current value of ests



227
228
229
# File 'lib/GECS.rb', line 227

def ests
  @ests
end

#experimentsObject

Returns the value of attribute experiments

Returns:

  • (Object)

    the current value of experiments



227
228
229
# File 'lib/GECS.rb', line 227

def experiments
  @experiments
end

#invTypesObject

Returns the value of attribute invTypes

Returns:

  • (Object)

    the current value of invTypes



227
228
229
# File 'lib/GECS.rb', line 227

def invTypes
  @invTypes
end

#parmDefsObject

Returns the value of attribute parmDefs

Returns:

  • (Object)

    the current value of parmDefs



227
228
229
# File 'lib/GECS.rb', line 227

def parmDefs
  @parmDefs
end

#parmsObject

Returns the value of attribute parms

Returns:

  • (Object)

    the current value of parms



227
228
229
# File 'lib/GECS.rb', line 227

def parms
  @parms
end

Instance Method Details

#getOrAdd(array, name) ⇒ Object

Methods to retrieve or create enum values. If a requested value does not already exist, it is added without fanfare.



240
241
242
243
244
245
246
247
248
249
# File 'lib/GECS.rb', line 240

def getOrAdd(array,name)
  raise "Can't add to nil" if array.nil?
  i = array.index(name)
  if i.nil?
    array.push(name)
    array.length-1
  else
    i
  end
end

#getOrAddEstMethod(name) ⇒ Object



254
255
256
257
# File 'lib/GECS.rb', line 254

def getOrAddEstMethod(name)
  self.estMethods ||= Array.new
  getOrAdd(estMethods,name)
end

#getOrAddEstMethodParm(name) ⇒ Object



258
259
260
261
# File 'lib/GECS.rb', line 258

def getOrAddEstMethodParm(name)
  self.estMethodParms ||= Array.new
  getOrAdd(estMethodParms,name)
end

#getOrAddInvType(name) ⇒ Object



262
263
264
265
# File 'lib/GECS.rb', line 262

def getOrAddInvType(name)
  self.invTypes ||= Array.new
  getOrAdd(invTypes,name)
end

#getOrAddParm(name) ⇒ Object



250
251
252
253
# File 'lib/GECS.rb', line 250

def getOrAddParm(name)
  self.parms ||= Array.new
  getOrAdd(parms,name)
end

#getOrAddParmDef(parmDef) ⇒ Object



266
267
268
269
# File 'lib/GECS.rb', line 266

def getOrAddParmDef(parmDef)
  self.parmDefs ||= Array.new
  getOrAdd(parmDefs,parmDef)
end

#to_sObject



234
235
236
# File 'lib/GECS.rb', line 234

def to_s
  experiments.join("\n")
end