class Onoma::Migration::Actions::NomenclatureChange

Attributes

changes[R]
nomenclature[R]

Public Class Methods

new(element) click to toggle source
# File lib/onoma/migration/actions/nomenclature_change.rb, line 7
def initialize(element)
  raise 'No given name' unless element.key?('nomenclature')

  @nomenclature = element['nomenclature'].to_s
  @changes = {}
  @changes[:name] = element['name'].to_s if element.key?('name')
  if element.key?('notions')
    @changes[:notions] = element.attr('notions').to_s.split(/\s*\,\s*/).map(&:to_sym)
  end
  if element.key?('translateable')
    @changes[:translateable] = element.attr('translateable').to_s != 'false'
  end
end

Public Instance Methods

human_name() click to toggle source
# File lib/onoma/migration/actions/nomenclature_change.rb, line 21
def human_name
  "Update nomenclature #{@name} with " + changes.inspect
end