Class: ItzLogger::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, type = ItzLogger::MessageType::INFO) ⇒ Message

Returns a new instance of Message.



17
18
19
20
21
22
23
24
# File 'lib/itz_logger/message.rb', line 17

def initialize(message, type = ItzLogger::MessageType::INFO)

  @id = SecureRandom.uuid
  @message = message
  @type = type
  @created_at = Time.now.utc

end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



15
16
17
# File 'lib/itz_logger/message.rb', line 15

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



15
16
17
# File 'lib/itz_logger/message.rb', line 15

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



15
16
17
# File 'lib/itz_logger/message.rb', line 15

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type.



15
16
17
# File 'lib/itz_logger/message.rb', line 15

def type
  @type
end