Sha256: 443315ed2945cc0e79f95db3d22e94181ccc95c4f1c094f3a6fe6670d4a71042
Contents?: true
Size: 1.32 KB
Versions: 21
Compression:
Stored size: 1.32 KB
Contents
module ActiveFedora # Class for attributes that are delegated to a RDFDatastream class RdfDatastreamAttribute < StreamAttribute # @param [ActiveFedora::Base] obj the object that has the attribute # @param [Object] v value to write to the attribute def writer(obj, v) node = file_for_attribute(obj, delegate_target) obj.mark_as_changed(field) if obj.value_has_changed?(field, v) term = if at vals = at.dup while vals.length > 1 node = node.send(vals.shift) node = node.build if node.empty? node = node.first end vals.first else field end node.send("#{term}=", v) end # @param [ActiveFedora::Base] obj the object that has the attribute def reader(obj) node = file_for_attribute(obj, delegate_target) term = if at vals = at.dup while vals.length > 1 node = node.send(vals.shift) node = if node.empty? node.build else node.first end end vals.first else field end node.send(term) end end end
Version data entries
21 entries across 21 versions & 1 rubygems