Class: RestCore::Event

Inherits:
EventStruct show all
Defined in:
lib/rest-core/event.rb

Defined Under Namespace

Classes: CacheCleared, CacheHit, Failed, MultiDone, Requested, Retrying, WithHeader

Instance Attribute Summary

Attributes inherited from EventStruct

#duration, #message

Instance Method Summary collapse

Instance Method Details

#nameObject



7
# File 'lib/rest-core/event.rb', line 7

def name; self.class.name[/(?<=::)\w+$/]; end

#to_sObject



8
9
10
11
12
13
14
# File 'lib/rest-core/event.rb', line 8

def to_s
  if duration
    "spent #{duration} #{name} #{message}"
  else
    "#{name} #{message}"
  end
end