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-0.7.2 lib/rest-core/event.rb
rest-core-0.7.0 lib/rest-core/event.rb
rest-core-0.4.0 lib/rest-core/event.rb
rest-core-0.4.0.pre.2 lib/rest-core/event.rb
rest-core-0.4.0.pre.1 lib/rest-core/event.rb
rest-core-0.4.0.pre.0 lib/rest-core/event.rb
rest-core-0.3.0 lib/rest-core/event.rb
rest-core-0.3.0.pre.2 lib/rest-core/event.rb
rest-core-0.3.0.pre.1 lib/rest-core/event.rb
rest-core-0.3.0.pre.0 lib/rest-core/event.rb
rest-core-0.2.3 lib/rest-core/event.rb
rest-core-0.2.2 lib/rest-core/event.rb
rest-core-0.2.1 lib/rest-core/event.rb
rest-core-0.2.0 lib/rest-core/event.rb
rest-core-0.0.1 lib/rest-core/event.rb