class Eco::API::Common::Session::Logger::Log
Attributes
datetime[RW]
formatted[RW]
level[RW]
message[RW]
Public Class Methods
new(level, datetime, message, formatted)
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 10 def initialize(level, datetime, message, formatted) @level = level @datetime = datetime @message = message @formatted = formatted end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 21 def <=>(other) self.datetime <=> other.datetime end
after?(value)
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 30 def after?(value) return true if !value datetime >= to_datetime(value) end
before?(value)
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 25 def before?(value) return true if !value datetime <= to_datetime(value) end
to_s()
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 17 def to_s self.formatted end
Private Instance Methods
to_datetime(value)
click to toggle source
# File lib/eco/api/common/session/logger/log.rb, line 37 def to_datetime(value) return value if value.is_a?(Time) return nil unless value Time.parse(value) end