Class: Mexico::FileSystem::Trial

Inherits:
Object
  • Object
show all
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

#corpus

Instance Method Summary collapse

Methods included from IdRef

id_ref

Methods included from BoundToCorpus

#bind_to_corpus

Constructor Details

#initialize(opts = {}) ⇒ Trial

creates a new Trial object.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :identifier (String)

    The identifier of the new trial object.

  • :description (String)

    The identifier of the new trial object.

  • :cue (String)

    The cue for the new trial object.

  • :running_number (Integer)

    The running number for the 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

Returns:

  • (Boolean)


83
84
85
# File 'lib/mexico/file_system/trial.rb', line 83

def linked_to_design?
  return design!=nil
end

#resourcesArray<Resource>

Returns a collection of resources that are associated with this trial.

Returns:

  • (Array<Resource>)

    an array of resources 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