Sha256: 63ab074c7dfde875b1faae30ce881c4b2bc76cf01345545ae57da29a444364d5

Contents?: true

Size: 481 Bytes

Versions: 5

Compression:

Stored size: 481 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

5 entries across 5 versions & 1 rubygems

Version Path
avo-0.5.0.beta9 lib/avo/fields/number_field.rb
avo-0.5.0.beta8 lib/avo/fields/number_field.rb
avo-0.5.0.beta7 lib/avo/fields/number_field.rb
avo-0.5.0.beta6 lib/avo/fields/number_field.rb
avo-0.5.0.beta5 lib/avo/fields/number_field.rb