Sha256: c636ad313d4c9f61ae67ad40ae8dc5d448b4a9e0bd3534afa3bad7ffee1d1808

Contents?: true

Size: 266 Bytes

Versions: 5

Compression:

Stored size: 266 Bytes

Contents

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

    def call(object)
      klass = "#{object.class}".gsub("::", "__")
      count = @counter.inc(klass)

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
angular_sprinkles-0.2.9 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.8 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.7 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.6 lib/angular_sprinkles/key_generator.rb
angular_sprinkles-0.2.5 lib/angular_sprinkles/key_generator.rb