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
271 272 273 274 275 276 277 |
# File 'lib/active_fedora/datastreams.rb', line 271 def has_file_datastream(args = {}) ds_specs[args.fetch(:name, "content")]= { :type => args.fetch(:type,ActiveFedora::Datastream), :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.
258 259 260 261 262 |
# File 'lib/active_fedora/datastreams.rb', line 258 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 |