Class: Hermeneutics::Timestamp

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = nil) ⇒ Timestamp

Returns a new instance of Timestamp.



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

def initialize value = nil
  self.value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.parse(str) ⇒ Object



46
47
48
49
# File 'lib/hermeneutics/types.rb', line 46

def parse str
  t = DateTime.parse str
  new t
end

Instance Method Details

#encodeObject



66
67
68
# File 'lib/hermeneutics/types.rb', line 66

def encode
  @value.rfc822
end

#quoteObject



63
64
65
# File 'lib/hermeneutics/types.rb', line 63

def quote
  to_s
end

#to_sObject



62
# File 'lib/hermeneutics/types.rb', line 62

def to_s ; @value.to_s ; end