Class: Hermeneutics::Timestamp

Inherits:
Time
  • Object
show all
Defined in:
lib/hermeneutics/types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(time = nil) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/hermeneutics/types.rb', line 42

def new time = nil
  case time
    when nil  then now
    when Time then mktime *time.to_a
    else           parse time.to_s
  end
end

Instance Method Details

#encodeObject



53
54
55
# File 'lib/hermeneutics/types.rb', line 53

def encode
  rfc822
end

#quoteObject



50
51
52
# File 'lib/hermeneutics/types.rb', line 50

def quote
  to_s
end