Class: Mexico::FileSystem::Design

Inherits:
Object
  • Object
show all
Includes:
Core::DesignCore, BoundToCorpus, Poseidon, ROXML
Defined in:
lib/mexico/file_system/design.rb

Instance Attribute Summary

Attributes included from BoundToCorpus

#corpus

Instance Method Summary collapse

Methods included from Core::DesignCore

#core_included?

Methods included from BoundToCorpus

#bind_to_corpus

Constructor Details

#initialize(opts = {}) ⇒ Design

Creates a new design object.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :identifier (String)

    The identifier of the new design (required).

  • :name (String)

    The name of the new design. (required).

  • :description (String)

    A description of the new design (optional).



57
58
59
60
61
# File 'lib/mexico/file_system/design.rb', line 57

def initialize(opts={})
  [:identifier,:name,:description].each do |att|
    send("#{att}=", opts[att]) if opts.has_key?(att)
  end
end

Instance Method Details

#after_parseObject



70
71
72
73
74
# File 'lib/mexico/file_system/design.rb', line 70

def after_parse
  design_components.each do |dc|
    dc.design = self
  end
end

#trialsArray<Trial>

Returns a collection of trials that are associated with this design.

Returns:

  • (Array<Trial>)

    an array of trials associated with this design.



65
66
67
# File 'lib/mexico/file_system/design.rb', line 65

def trials
  @corpus.trials.select{ |i| i.design === self }
end