Class: CloudLogger::Event
- Inherits:
-
Object
- Object
- CloudLogger::Event
- Defined in:
- lib/event.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(text, timestamp) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(text, timestamp) ⇒ Event
Returns a new instance of Event.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/event.rb', line 9 def initialize(text, ) @text = text if .instance_of? DateTime @timestamp = elsif .instance_of? Fixnum @timestamp = DateTime.new() else @timestamp = DateTime.parse(.to_s) end end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'lib/event.rb', line 7 def text @text end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
7 8 9 |
# File 'lib/event.rb', line 7 def @timestamp end |