Sha256: bddf6d8ac2d9699fed9527983f395c57eabca395e00efa5605f2dbe2a102b9c7

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

module ActiveFedora
  class DatastreamHash < Hash
    
    def initialize (obj)
      @obj = obj
      super()
    end

    def [] (key)
      if key == 'DC' && !has_key?(key)
        ds = Datastream.new(@obj.inner_object, key, :controlGroup=>'X')
        self[key] = ds
      end
      super
    end 

    def []= (key, val)
      @obj.inner_object.datastreams[key]=val# unless @obj.inner_object.new?
      super
    end 

    def freeze
      each_value do |datastream|
        datastream.freeze
      end
      super
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active-fedora-7.0.0.rc2 lib/active_fedora/datastream_hash.rb