Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/thetvdb_api/utility/time.rb

Class Method Summary collapse

Class Method Details

.coerce(value) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/thetvdb_api/utility/time.rb', line 2

def self.coerce(value)
  begin
    Time.parse(value)
  rescue
    Time.at(value.to_i)
  end
end