Class: ActiveElement::Components::Util::NumericField
- Inherits:
-
Object
- Object
- ActiveElement::Components::Util::NumericField
- Defined in:
- lib/active_element/components/util/numeric_field.rb
Overview
Provides options for a ‘<input type=“number” />` element based on database column properties.
Instance Method Summary collapse
-
#initialize(field:, column:) ⇒ NumericField
constructor
A new instance of NumericField.
- #options ⇒ Object
Constructor Details
#initialize(field:, column:) ⇒ NumericField
Returns a new instance of NumericField.
8 9 10 11 |
# File 'lib/active_element/components/util/numeric_field.rb', line 8 def initialize(field:, column:) @field = field @column = column end |
Instance Method Details
#options ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/active_element/components/util/numeric_field.rb', line 13 def { step: step, min: min, max: max }.compact end |