Module: Mexico::FileSystem::BoundToCorpus

Included in:
Design, DesignComponent, LocalFile, Participant, ParticipantRole, Resource, Trial, URL
Defined in:
lib/mexico/file_system/bound_to_corpus.rb

Overview

XML bound elements know the corpus object, the corpus file, and the nokogiri element they come from and can write changes back to that file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#corpusObject

Returns the value of attribute corpus


25
26
27
# File 'lib/mexico/file_system/bound_to_corpus.rb', line 25

def corpus
  @corpus
end

Instance Method Details

#bind_to_corpus(param_corpus) ⇒ Object

sets up the bound between the object and the corpus elements


28
29
30
31
32
33
34
35
# File 'lib/mexico/file_system/bound_to_corpus.rb', line 28

def bind_to_corpus(param_corpus)
  @corpus = param_corpus
  
  if self.respond_to?(:when_bound_to_corpus)
    self.when_bound_to_corpus
  end
  
end