Module: Ddr::Models::Licensable
Instance Method Summary collapse
Instance Method Details
#license ⇒ Object
12 13 14 15 16 |
# File 'lib/ddr/models/licensable.rb', line 12 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 |
#license=(new_license) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/ddr/models/licensable.rb', line 18 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 |