Sha256: 5c876ead0d703497bfdb8a1f1542940d69d2c99fee8f1e1a381ecf3484efd1f7

Contents?: true

Size: 244 Bytes

Versions: 12

Compression:

Stored size: 244 Bytes

Contents

module AngularSprinkles
  class KeyGenerator
    def initialize(args)
      @counter = args.fetch(:counter)
    end

    def call(object)
      klass = object.class
      count = @counter.inc(klass)

      "#{klass}_#{count}"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
angular_sprinkles-0.2.4 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.3 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.2 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.1 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.0 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.1.1 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.1.0 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.0.9 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.0.8 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.0.7 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.0.6 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.0.5 lib/angular_sprinkles/key_generator.rb