Sha256: caca576c7edcedec9f15513e6b3977daa5d363308145e683f9a5d5cf3ba480b9

Contents?: true

Size: 380 Bytes

Versions: 142

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

module Document
  module AttributeInitializer
    class Enum < Base
      def call
        yield name, type, options
        configure_enums
      end

      private

      def configure_enums
        enums = options[:enums] || Document::Enum.default_enums(klass.model_name, name)
        klass.enumerize name, in: enums
      end
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.1.0 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.167 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.166 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.165 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.164 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.163 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.162 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.161 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.160 app/documents/document/attribute_initializer/enum.rb
renalware-core-2.0.159 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.158 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.157 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.156 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.155 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.153 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.152 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.151 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.149 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.148 lib/document/attribute_initializer/enum.rb