Class: Fluent::Plugin::ObjectSpaceInput::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/in_object_space.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, init_count) ⇒ Counter

Returns a new instance of Counter.



46
47
48
49
# File 'lib/fluent/plugin/in_object_space.rb', line 46

def initialize(klass, init_count)
  @klass = klass
  @count = init_count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



59
60
61
# File 'lib/fluent/plugin/in_object_space.rb', line 59

def count
  @count
end

Instance Method Details

#incr!Object



51
52
53
# File 'lib/fluent/plugin/in_object_space.rb', line 51

def incr!
  @count += 1
end

#nameObject



55
56
57
# File 'lib/fluent/plugin/in_object_space.rb', line 55

def name
  @klass.name
end