Class: Hermeneutics::Timestamp
- Inherits:
-
Object
- Object
- Hermeneutics::Timestamp
- Defined in:
- lib/hermeneutics/types.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(value = nil) ⇒ Timestamp
constructor
A new instance of Timestamp.
- #quote ⇒ Object
- #to_s ⇒ Object
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
#value ⇒ Object
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
#encode ⇒ Object
66 67 68 |
# File 'lib/hermeneutics/types.rb', line 66 def encode @value.rfc822 end |
#quote ⇒ Object
63 64 65 |
# File 'lib/hermeneutics/types.rb', line 63 def quote to_s end |
#to_s ⇒ Object
62 |
# File 'lib/hermeneutics/types.rb', line 62 def to_s ; @value.to_s ; end |