Sha256: f5ef23bfd538f33da276c4f187cf22ed96d257a039752518d6ef39c43f92634e

Contents?: true

Size: 479 Bytes

Versions: 36

Compression:

Stored size: 479 Bytes

Contents

module Avo
  module Fields
    class NumberField < TextField
      def initialize(name, **args, &block)
        @defaults = {
          partial_name: "number-field",
          computable: true
        }

        super(name, **args, &block)

        @meta = {
          min: args[:min].present? ? args[:min].to_f : nil,
          max: args[:max].present? ? args[:max].to_f : nil,
          step: args[:step].present? ? args[:step].to_f : nil
        }
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
avo-1.4.0.pre.1 lib/avo/fields/number_field.rb
avo-1.3.5 lib/avo/fields/number_field.rb
avo-1.3.5.pre.1 lib/avo/fields/number_field.rb
avo-1.3.4 lib/avo/fields/number_field.rb
avo-1.3.3 lib/avo/fields/number_field.rb
avo-1.3.2 lib/avo/fields/number_field.rb
avo-1.3.1 lib/avo/fields/number_field.rb
avo-1.3.0 lib/avo/fields/number_field.rb
avo-1.2.11.pre.4 lib/avo/fields/number_field.rb
avo-1.2.11.pre.3 lib/avo/fields/number_field.rb
avo-1.2.11.pre.2 lib/avo/fields/number_field.rb
avo-1.2.11.pre.1 lib/avo/fields/number_field.rb
avo-1.2.10 lib/avo/fields/number_field.rb
avo-1.2.9 lib/avo/fields/number_field.rb
avo-1.2.8 lib/avo/fields/number_field.rb
avo-1.2.7 lib/avo/fields/number_field.rb
avo-1.2.6 lib/avo/fields/number_field.rb
avo-1.2.6.pre.1 lib/avo/fields/number_field.rb
avo-1.2.5 lib/avo/fields/number_field.rb
avo-1.2.4 lib/avo/fields/number_field.rb