class GitDS::ProxyProperty

A Property that is a link to a ModelItem class instance.

Attributes

obj_class[R]

Public Class Methods

new(name, cls, fs=false, &block) click to toggle source
Calls superclass method GitDS::PropertyDefinition::new
# File lib/git-ds/model/property.rb, line 172
def initialize(name, cls, fs=false, &block)
  super name, nil, fs, &block
  @obj_class = cls
end

Public Instance Methods

get(model, parent_path) click to toggle source

Instantiate object from path stored in property.

Calls superclass method GitDS::PropertyDefinition#get
# File lib/git-ds/model/property.rb, line 187
def get(model, parent_path)
  # the object path is stored in the property file
  obj_path = super model, parent_path
  @obj_class.new(model, obj_path) if obj_path && (not obj_path.empty?)
end
set(model, parent_path, obj) click to toggle source

Write path of object to property.

Calls superclass method GitDS::PropertyDefinition#set
# File lib/git-ds/model/property.rb, line 180
def set(model, parent_path, obj)
  super model, parent_path, obj.path
end