Class: Rtasklib::Models::VirtusDuration
- Inherits:
-
Virtus::Attribute
- Object
- Virtus::Attribute
- Rtasklib::Models::VirtusDuration
- Defined in:
- lib/rtasklib/models.rb
Overview
Custom coercer that changes a string input into an TWDuration object If nil? or blank? it returns nil
Modifies the #coerce method.
Instance Method Summary (collapse)
Instance Method Details
- (TWDuration?) coerce(v)
36 37 38 |
# File 'lib/rtasklib/models.rb', line 36 def coerce(v) if v.nil? || v.blank? then nil else TWDuration.new(v) end end |