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
270 271 272 273 274 275 |
# File 'lib/active_fedora/datastreams.rb', line 270 def has_file_datastream(args = {}) spec = {:autocreate => args.fetch(:autocreate, true), :type => args.fetch(:type,ActiveFedora::Datastream), :label => args.fetch(:label,"File Datastream"), :control_group => args.fetch(:control_group,"M")} spec[:versionable] = args[:versionable] if args.has_key? :versionable ds_specs[args.fetch(:name, "content")]= spec 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.
255 256 257 258 259 |
# File 'lib/active_fedora/datastreams.rb', line 255 def (args, &block) spec = {:autocreate => args.fetch(:autocreate, true), :type => args[:type], :label => args.fetch(:label,""), :control_group => args[:control_group], :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 |