Sha256: 4f1966d08c2e8db4f2462a8ba71255d16c32ee6326cb9e363118430eb595a277

Contents?: true

Size: 579 Bytes

Versions: 35

Compression:

Stored size: 579 Bytes

Contents

module RestCore
  EventStruct = Struct.new(:duration, :message) unless
    RestCore.const_defined?(:EventStruct)

  class Event < EventStruct
    # self.class.name[/(?<=::)\w+$/] if RUBY_VERSION >= '1.9.2'
    def name; self.class.name[/::(\w+)$/, 1]        ; end
    def to_s; "spent #{duration} #{name} #{message}"; end
  end
  class Event::MultiDone    < Event; end
  class Event::Requested    < Event; end
  class Event::CacheHit     < Event; end
  class Event::CacheCleared < Event; end
  class Event::Failed       < Event; end
  class Event::WithHeader   < Event; end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rest-core-3.3.0 lib/rest-core/event.rb
rest-core-3.2.0 lib/rest-core/event.rb
rest-core-3.1.1 lib/rest-core/event.rb
rest-core-3.1.0 lib/rest-core/event.rb
rest-core-3.0.0 lib/rest-core/event.rb
rest-core-2.1.2 lib/rest-core/event.rb
rest-core-2.1.1 lib/rest-core/event.rb
rest-core-2.1.0 lib/rest-core/event.rb
rest-core-2.0.4 lib/rest-core/event.rb
rest-core-2.0.3 lib/rest-core/event.rb
rest-core-2.0.2 lib/rest-core/event.rb
rest-core-2.0.1 lib/rest-core/event.rb
rest-core-2.0.0 lib/rest-core/event.rb
rest-core-1.0.3 lib/rest-core/event.rb
rest-core-1.0.2 lib/rest-core/event.rb
rest-core-1.0.1 lib/rest-core/event.rb
rest-core-1.0.0 lib/rest-core/event.rb
rest-core-0.8.2 lib/rest-core/event.rb
rest-core-0.8.1 lib/rest-core/event.rb
rest-core-0.8.0 lib/rest-core/event.rb