class Mexico::FileSystem::ItemLink

A link from an item to a layer.

Constants

INVERSE_ROLES
ROLE_CHILD
ROLE_PARENT
ROLE_PREDECESSOR
ROLE_SUCCESSOR

Attributes

document[RW]
item[RW]

Public Class Methods

new(args={}) click to toggle source
# File lib/mexico/file_system/item_link.rb, line 61
def initialize(args={})
  args.each do |k,v|
    if self.respond_to?("#{k}=")
      send("#{k}=", v)
    end
  end
end

Public Instance Methods

after_parse() click to toggle source

This method attempts to link objects from other locations of the XML/object tree into position inside this object, by following the xml ids given in the appropriate fields of this class.

# File lib/mexico/file_system/item_link.rb, line 87
def after_parse
  # puts "item link after parse. What is the situation?"
  #
  # if ::Mexico::FileSystem::FiestaDocument.knows?(target)
  #   puts "  store knows the needed target. fetch it and set it."
  #   @target_object=::Mexico::FileSystem::FiestaDocument.resolve(target)
  #   puts "    %s" % @target_object
  # else
  #   # store i in watch list
  #   ::Mexico::FileSystem::FiestaDocument.watch(target, item, :target_object=)
  # end
end
identifier=(new_id) click to toggle source
# File lib/mexico/file_system/item_link.rb, line 40
def identifier=(new_id)
  @identifier = Mexico::Util::to_xml_id(new_id)
end
target_item()
Alias for: target_object
target_object() click to toggle source

returns the target object, in this case, an Item. @return (Mexico::FileSystem::Item) the scale this interval link points to.

# File lib/mexico/file_system/item_link.rb, line 71
def target_object
  @target_object
end
Also aliased as: target_item
target_object=(new_target) click to toggle source

Sets a new target object (and updates the corresponding identifier) @param (Mexico::FileSystem::Item) new_target The new target object to set @return (void)

# File lib/mexico/file_system/item_link.rb, line 78
def target_object=(new_target)
  # puts "SETTING target object to %s, %s" % [new_target.identifier, new_target]
  @target_object=new_target
  @target=target_object.identifier
end