Class: Mexico::FileSystem::LayerConnector

Inherits:
Object
  • Object
show all
Includes:
ROXML
Defined in:
lib/mexico/file_system/layer_connector.rb

Overview

A typed connector between two layers (or tiers) in an transcription or annotation document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_source = nil, new_target = nil, args = {}) ⇒ LayerConnector

Returns a new instance of LayerConnector.



41
42
43
44
45
46
47
48
49
# File 'lib/mexico/file_system/layer_connector.rb', line 41

def initialize(new_source=nil, new_target=nil, args={})
  self.source= new_source
  self.target= new_target
  args.each do |k,v|
    if self.respond_to?("#{k}=")
      send("#{k}=", v)
    end
  end
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



38
39
40
# File 'lib/mexico/file_system/layer_connector.rb', line 38

def document
  @document
end

Instance Method Details

#identifier=(new_id) ⇒ Object



27
28
29
# File 'lib/mexico/file_system/layer_connector.rb', line 27

def identifier=(new_id)
  @identifier = Mexico::Util::to_xml_id(new_id)
end

#sourceLayer

Retrieves the source layer for this layer connector.

Returns:

  • (Layer)

    The source layer.



53
54
55
# File 'lib/mexico/file_system/layer_connector.rb', line 53

def source
  @source
end

#source=(new_source_layer) ⇒ void

This method returns an undefined value.

Sets a new source layer for this layer connector.

Parameters:

  • new_source_layer (Layer)

    The layer to be set as the new source.



60
61
62
63
# File 'lib/mexico/file_system/layer_connector.rb', line 60

def source=(new_source_layer)
  @source = new_source_layer
  @source_id = @source.identifier
end

#targetLayer

Retrieves the target layer for this layer connector.

Returns:

  • (Layer)

    The target layer.



67
68
69
# File 'lib/mexico/file_system/layer_connector.rb', line 67

def target
  @target
end

#target=(new_target_layer) ⇒ void

This method returns an undefined value.

Sets a new target layer for this layer connector.

Parameters:

  • new_target_layer (Layer)

    The layer to be set as the new target.



74
75
76
77
# File 'lib/mexico/file_system/layer_connector.rb', line 74

def target=(new_target_layer)
  @target = new_target_layer
  @target_id = @target.identifier
end