Module: Taxii::TimeExtensions

Defined in:
lib/taxii/time_extensions.rb

Instance Method Summary collapse

Instance Method Details

#coerce(val) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/taxii/time_extensions.rb', line 3

def coerce(val)
  case val
    when Integer
      Time.at(val)
    when String
      Time.parse(val)
    else
      val
  end
end