Class: Mexico::FileSystem::Trial
- Inherits:
-
Object
- Object
- Mexico::FileSystem::Trial
- Extended by:
- IdRef
- Includes:
- BoundToCorpus, Poseidon, ROXML
- Defined in:
- lib/mexico/file_system/trial.rb
Overview
Trials model the events from reality that form the ultimate substrate of a corpus. Trials are usually numbered sequentially. A trial stands for a specific clip or segment of reality, e.g., a time span and a location in space where the events under observation occurred.
Instance Attribute Summary
Attributes included from BoundToCorpus
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Trial
constructor
creates a new Trial object.
- #linked_to_design? ⇒ Boolean
-
#resources ⇒ Array<Resource>
Returns a collection of resources that are associated with this trial.
Methods included from IdRef
Methods included from BoundToCorpus
Constructor Details
#initialize(opts = {}) ⇒ Trial
creates a new Trial object.
70 71 72 73 74 75 |
# File 'lib/mexico/file_system/trial.rb', line 70 def initialize(opts={}) # @corpus = corpus [:identifier,:name,:description,:cue,:running_number].each do |att| send("#{att}=", opts[att]) if opts.has_key?(att) end end |
Instance Method Details
#linked_to_design? ⇒ Boolean
83 84 85 |
# File 'lib/mexico/file_system/trial.rb', line 83 def linked_to_design? return design!=nil end |
#resources ⇒ Array<Resource>
Returns a collection of resources that are associated with this trial.
79 80 81 |
# File 'lib/mexico/file_system/trial.rb', line 79 def resources @corpus.resources.select{ |i| i.trial === self } end |