Module: ActiveFedora::Datastreams::ClassMethods
- Defined in:
- lib/active_fedora/datastreams.rb
Instance Method Summary collapse
-
#has_file_datastream(args) ⇒ Object
Specify the attributes of a file bearing datastream .
-
#has_metadata(args) { ... } ⇒ Object
This method is used to specify the details of a datastream.
Instance Method Details
#has_file_datastream(args) ⇒ Object
Specify the attributes of a file bearing datastream
Options
- :name
-
The dsid of the datastream
- :type
-
The class the datastream should have
- :label
-
The default value to put in the dsLabel field
- :control_group
-
The type of controlGroup to store the datastream as. Defaults to M
271 272 273 |
# File 'lib/active_fedora/datastreams.rb', line 271 def has_file_datastream(args) ds_specs[args.fetch(:name, "content")]= {:type => args[:type], :label => args.fetch(:label,"File Datastream"), :control_group => args.fetch(:control_group,"M")} end |
#has_metadata(args) { ... } ⇒ Object
This method is used to specify the details of a datastream. args must include :name. Note that this method doesn’t actually execute the block, but stores it at the class level, to be executed by any future instantiations.
254 255 256 257 258 |
# File 'lib/active_fedora/datastreams.rb', line 254 def (args, &block) spec = {:type => args[:type], :label => args.fetch(:label,""), :control_group => args.fetch(:control_group,"X"), :disseminator => args.fetch(:disseminator,""), :url => args.fetch(:url,""),:block => block} spec[:versionable] = args[:versionable] if args.has_key? :versionable ds_specs[args[:name]]= spec end |