Class: Stockboy::Translations::Integer
- Inherits:
-
Stockboy::Translator
- Object
- Stockboy::Translator
- Stockboy::Translations::Integer
- Defined in:
- lib/stockboy/translations/integer.rb
Overview
Translate string values to Integer
Job template DSL
Registered as :integer
. Use with:
attributes do
children as: :integer
end
Instance Attribute Summary
Attributes inherited from Stockboy::Translator
Instance Method Summary collapse
Methods inherited from Stockboy::Translator
Constructor Details
This class inherits a constructor from Stockboy::Translator
Instance Method Details
#translate(context) ⇒ Integer
25 26 27 28 29 30 |
# File 'lib/stockboy/translations/integer.rb', line 25 def translate(context) value = field_value(context, field_key) return nil if value.blank? value.to_i end |