Class: CloudLogger::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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, timestamp)
  @text = text
  
  if timestamp.instance_of? DateTime
    @timestamp = timestamp
  elsif timestamp.instance_of? Fixnum
    @timestamp = DateTime.new(timestamp)
  else
    @timestamp = DateTime.parse(timestamp.to_s)
  end
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



7
8
9
# File 'lib/event.rb', line 7

def text
  @text
end

#timestampObject

Returns the value of attribute timestamp.



7
8
9
# File 'lib/event.rb', line 7

def timestamp
  @timestamp
end