Class: Fields::Number
- Inherits:
-
Field
- Object
- Field
- Fields::Number
- Defined in:
- app/models/iron/fields/number.rb
Instance Method Summary collapse
Instance Method Details
#content_value=(value) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/models/iron/fields/number.rb', line 5 def content_value=(value) @content_errors = nil if value.nil? || value.is_a?(Numeric) || numeric_string?(value) self.value_float = value else add_content_error("must be a number") end end |
#export_value ⇒ Object
21 22 23 |
# File 'app/models/iron/fields/number.rb', line 21 def export_value { type: "number", value: value_float } end |
#filled? ⇒ Boolean
15 |
# File 'app/models/iron/fields/number.rb', line 15 def filled? = !value_float.nil? |
#value ⇒ Object
17 18 19 |
# File 'app/models/iron/fields/number.rb', line 17 def value value_float end |