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



220
221
222
# File 'lib/GECS.rb', line 220

def data
  @data
end

#estMethodParmsObject

Returns the value of attribute estMethodParms

Returns:

  • (Object)

    the current value of estMethodParms



220
221
222
# File 'lib/GECS.rb', line 220

def estMethodParms
  @estMethodParms
end

#estMethodsObject

Returns the value of attribute estMethods

Returns:

  • (Object)

    the current value of estMethods



220
221
222
# File 'lib/GECS.rb', line 220

def estMethods
  @estMethods
end

#estsObject

Returns the value of attribute ests

Returns:

  • (Object)

    the current value of ests



220
221
222
# File 'lib/GECS.rb', line 220

def ests
  @ests
end

#experimentsObject

Returns the value of attribute experiments

Returns:

  • (Object)

    the current value of experiments



220
221
222
# File 'lib/GECS.rb', line 220

def experiments
  @experiments
end

#invTypesObject

Returns the value of attribute invTypes

Returns:

  • (Object)

    the current value of invTypes



220
221
222
# File 'lib/GECS.rb', line 220

def invTypes
  @invTypes
end

#parmDefsObject

Returns the value of attribute parmDefs

Returns:

  • (Object)

    the current value of parmDefs



220
221
222
# File 'lib/GECS.rb', line 220

def parmDefs
  @parmDefs
end

#parmsObject

Returns the value of attribute parms

Returns:

  • (Object)

    the current value of parms



220
221
222
# File 'lib/GECS.rb', line 220

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.



233
234
235
236
237
238
239
240
241
242
# File 'lib/GECS.rb', line 233

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



247
248
249
250
# File 'lib/GECS.rb', line 247

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

#getOrAddEstMethodParm(name) ⇒ Object



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

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

#getOrAddInvType(name) ⇒ Object



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

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

#getOrAddParm(name) ⇒ Object



243
244
245
246
# File 'lib/GECS.rb', line 243

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

#getOrAddParmDef(parmDef) ⇒ Object



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

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

#to_sObject



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

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