Sha256: c044be289da895056e4dd0e1ffcb401b3787e73b3f4e6244b3237e1d701fbb35

Contents?: true

Size: 778 Bytes

Versions: 8

Compression:

Stored size: 778 Bytes

Contents

module Onoma
  class Migration
    module Actions
      class NomenclatureCreation < Onoma::Migration::Actions::Base
        attr_reader :nomenclature, :options

        def initialize(element)
          @nomenclature = element.key?('nomenclature') ? element['nomenclature'].to_s : element.key?('name') ? element['name'].to_s : nil
          raise 'No given name' unless @nomenclature
          @options = {}
          notions = element.attr('notions').to_s.split(/\s*\,\s*/).map(&:to_sym)
          @options[:notions] = notions if notions.any?
          @options[:translateable] = element.attr('translateable').to_s != 'false'
        end

        alias name nomenclature

        def human_name
          "Create nomenclature #{@name}"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
onoma-0.3.4 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.3.3 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.3.1 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.2.2 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.2.1 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.2.0 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.1.1 lib/onoma/migration/actions/nomenclature_creation.rb
onoma-0.1.0 lib/onoma/migration/actions/nomenclature_creation.rb