Class: Jirarest2Field::NumberField

Inherits:
TextField show all
Defined in:
lib/jirarest2/field.rb

Overview

TODO:

See to recognize allowed - might hide in schema

A field representing Numbers (not Strings with Numbers)

Instance Attribute Summary

Attributes inherited from Field

#allowed_values, #id, #name, #raw_value, #readonly, #required

Instance Method Summary collapse

Methods inherited from Field

#createmeta, #initialize, #parse_value, #to_j, #value, #value_allowed?

Constructor Details

This class inherits a constructor from Jirarest2Field::Field

Instance Method Details

#value=(content) ⇒ Object

Set the value

Parameters:

  • content (String, Fixnum)

    A number



250
251
252
253
254
255
256
257
# File 'lib/jirarest2/field.rb', line 250

def value=(content)
  if content.instance_of?(String) then
    value = content.to_f 
  else
    value = content
  end
  @value = value if value_allowed?(value)
end