Class: Easy::Resources::Redmine::CustomField
- Inherits:
-
RedmineBase
- Object
- ActiveResource::Base
- Easy::Resource
- RedmineBase
- Easy::Resources::Redmine::CustomField
- Defined in:
- lib/easy/resources/redmine/custom_field.rb
Instance Method Summary collapse
-
#cast_value ⇒ Object
Formatted value based on field_format.
Methods inherited from RedmineBase
configure, #errors, get_all, headers, retrieve_total
Methods inherited from Easy::Resource
#becomes, configure, configure_bearer, #patch, #update_column, #update_columns
Instance Method Details
#cast_value ⇒ Object
Returns formatted value based on field_format.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/easy/resources/redmine/custom_field.rb', line 16 def cast_value case field_format when "bool" value.to_s =~ /1|true/i ? true : false when "float", "amount" value.to_f when "int" value.to_i when "date" Date.parse value when "datetime" DateTime.parse value else value end end |