Class: Rtasklib::Models::VirtusDuration

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/rtasklib/models.rb

Overview

Custom coercer to change a string input into an TWDuration object

Instance Method Summary collapse

Instance Method Details

#coerce(v) ⇒ Object



25
26
27
# File 'lib/rtasklib/models.rb', line 25

def coerce(v)
  if v.nil? || v.blank? then nil else TWDuration.new(v) end
end