Sha256: 0231264e0c7fdee03418ce3649e5b71347b52d637f03c735abb0037c933b8648
Contents?: true
Size: 1.01 KB
Versions: 27
Compression:
Stored size: 1.01 KB
Contents
module Ddr module Models module Licensable extend ActiveSupport::Concern included do has_attributes :license_title, datastream: Ddr::Datastreams::RIGHTS_METADATA, at: [:license, :title], multiple: false has_attributes :license_description, datastream: Ddr::Datastreams::RIGHTS_METADATA, at: [:license, :description], multiple: false has_attributes :license_url, datastream: Ddr::Datastreams::RIGHTS_METADATA, at: [:license, :url], multiple: false end def license if license_title.present? or license_description.present? or license_url.present? {title: license_title, description: license_description, url: license_url}.with_indifferent_access end end def license=(new_license) raise ArgumentError unless new_license.is_a?(Hash) l = new_license.with_indifferent_access self.license_title = l[:title] self.license_description = l[:description] self.license_url = l[:url] end end end end
Version data entries
27 entries across 27 versions & 1 rubygems