Sha256: a2878126e7848c5939aa1d0ea402f61a5e722f8430d070b68c301d4b06f74ee9
Contents?: true
Size: 935 Bytes
Versions: 21
Compression:
Stored size: 935 Bytes
Contents
module ActiveFedora # Class for attributes that are delegated to an OmDatastream class OmAttribute < StreamAttribute # @param [ActiveFedora::Base] obj the object that has the attribute # @param [Object] v value to write to the attribute def writer(obj, v) ds = file_for_attribute(obj, delegate_target) obj.mark_as_changed(field) if obj.value_has_changed?(field, v) terminology = at || [field] ds.send(:update_indexed_attributes, terminology => v) end # @param [ActiveFedora::Base] obj the object that has the attribute # @param [Object] opts extra options that are passed to the target reader def reader(obj, *opts) ds = file_for_attribute(obj, delegate_target) terminology = at || [field] if terminology.length == 1 && opts.present? ds.send(terminology.first, *opts) else ds.send(:term_values, *terminology) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems