Class: ModsDisplay::AccessCondition

Inherits:
Field
  • Object
show all
Defined in:
lib/mods_display/fields/access_condition.rb

Constant Summary collapse

LICENSES =
{
  'cc-none' => { desc: '' },
  'cc-by' => {
    link: 'http://creativecommons.org/licenses/by/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution 3.0 Unported License'
  },
  'cc-by-sa' => {
    link: 'http://creativecommons.org/licenses/by-sa/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License'
  },
  'cc-by-nd' => {
    link: 'http://creativecommons.org/licenses/by-nd/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution-No Derivative Works 3.0 Unported License'
  },
  'cc-by-nc' => {
    link: 'http://creativecommons.org/licenses/by-nc/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License'
  },
  'cc-by-nc-sa' => {
    link: 'http://creativecommons.org/licenses/by-nc-sa/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License'
  },
  'cc-by-nc-nd' => {
    link: 'http://creativecommons.org/licenses/by-nc-nd/3.0/',
    desc: 'This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License'
  },
  'cc-pdm' => {
    link: 'http://creativecommons.org/publicdomain/mark/1.0/',
    desc: 'This work is in the public domain per Creative Commons Public Domain Mark 1.0'
  },
  'odc-odc-pddl' => {
    link: 'http://opendatacommons.org/licenses/pddl/',
    desc: 'This work is licensed under a Open Data Commons Public Domain Dedication and License (PDDL)'
  },
  'odc-pddl' => {
    link: 'http://opendatacommons.org/licenses/pddl/',
    desc: 'This work is licensed under a Open Data Commons Public Domain Dedication and License (PDDL)'
  },
  'odc-odc-by' => {
    link: 'http://opendatacommons.org/licenses/by/',
    desc: 'This work is licensed under a Open Data Commons Attribution License'
  },
  'odc-odc-odbl' => {
    link: 'http://opendatacommons.org/licenses/odbl/',
    desc: 'This work is licensed under a Open Data Commons Open Database License (ODbL)'
  }
}.freeze

Instance Method Summary collapse

Methods inherited from Field

#initialize, #label, #render_in, #to_html

Constructor Details

This class inherits a constructor from ModsDisplay::Field

Instance Method Details

#fieldsObject



53
54
55
56
57
58
59
60
61
# File 'lib/mods_display/fields/access_condition.rb', line 53

def fields
  return_fields = @values.map do |value|
    ModsDisplay::Values.new(
      label: displayLabel(value) || access_label(value),
      values: [process_access_statement(value)]
    )
  end
  collapse_fields(return_fields)
end