Class: LogWeaver::CombinedLogIndexKey

Inherits:
Struct
  • Object
show all
Includes:
Comparable
Defined in:
lib/log_weaver/combined_log_index_key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



2
3
4
# File 'lib/log_weaver/combined_log_index_key.rb', line 2

def prefix
  @prefix
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



2
3
4
# File 'lib/log_weaver/combined_log_index_key.rb', line 2

def timestamp
  @timestamp
end

Instance Method Details

#<=>(other) ⇒ Object



5
6
7
8
# File 'lib/log_weaver/combined_log_index_key.rb', line 5

def <=>(other)
  return timestamp <=> other.timestamp unless timestamp == other.timestamp
  return prefix <=> other.prefix
end

#to_sObject



10
11
12
# File 'lib/log_weaver/combined_log_index_key.rb', line 10

def to_s
  "#{prefix}#{timestamp}"
end