Sha256: e6b5c592317fb9206802bb181c0cde5faf7fc1c118924db07d2ab05fdee561ee

Contents?: true

Size: 344 Bytes

Versions: 9

Compression:

Stored size: 344 Bytes

Contents

require_relative "base"

module RailsSettingsUi
  module ValueTypes
    class Float < RailsSettingsUi::ValueTypes::Base
      def cast
        value.to_f
      end
    
      def validate
        unless value_numeric?
          self.errors << I18n.t("settings.errors.invalid_numeric", default: 'Invalid')
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails-settings-ui-0.5.0 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.4.0 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.3.2 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.3.1 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.2.1 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.3.0 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.2.0 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.1.1 lib/rails-settings-ui/value_types/float.rb
rails-settings-ui-0.1.0 lib/rails-settings-ui/value_types/float.rb