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.0.84 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.83 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.82 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.81 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.80 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.79 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.78 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.77 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.76 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.75 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.74 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.73 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.72 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.71 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.70 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.69 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.68 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.67 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.64 lib/document/attribute_initializer/enum.rb
renalware-core-2.0.63 lib/document/attribute_initializer/enum.rb