# class Counter

Implements a simple accumulator, whose value is accessed via the attribute counter. Calling the method `Counter#inc` increments this value.

### Attributes

counter [R]

The current value of the count

### Public Class Methods

new (initial_value = 0)
Source

    # File counter.rb, line 11
    def initialize(initial_value = 0)
      @counter = initial_value
    end

create a new `Counter` with the given initial value

### Public Instance Methods

inc ()
Source

    # File counter.rb, line 16
    def inc
      @counter += 1
    end

increment the current value of the count