Module: Redlics::Counter

Extended by:
Counter
Included in:
Counter
Defined in:
lib/redlics/counter.rb

Overview

Counter class

Constant Summary collapse

CONTEXT =

Context constant for given class.

Redlics::CONTEXTS[:counter].freeze

Instance Method Summary collapse

Instance Method Details

#count(*args, &block) ⇒ Array

Count for a given event and object id with options.

Parameters:

  • *args (Array)

    list of arguments for count

Returns:

  • (Array)

    list of counted granularities



15
16
17
18
19
# File 'lib/redlics/counter.rb', line 15

def count(*args, &block)
  return count_with_block(&block) if block_given?
  return count_with_hash(args.first) if args.first.is_a?(Hash)
  count_with_args(*args)
end