Class: Fluent::Plugin::ObjectSpaceInput::Counter
- Inherits:
-
Object
- Object
- Fluent::Plugin::ObjectSpaceInput::Counter
- Defined in:
- lib/fluent/plugin/in_object_space.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
- #incr! ⇒ Object
-
#initialize(klass, init_count) ⇒ Counter
constructor
A new instance of Counter.
- #name ⇒ Object
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
#count ⇒ Object (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 |
#name ⇒ Object
55 56 57 |
# File 'lib/fluent/plugin/in_object_space.rb', line 55 def name @klass.name end |