Sha256: a6daecebfa87bb8e9dc05440a01870692f1e1e0d7cc17ede109f59f6d362d452

Contents?: true

Size: 376 Bytes

Versions: 10

Compression:

Stored size: 376 Bytes

Contents

require "digest/md5"

module Flipflop
  module Strategies
    class OptionsHasher
      def initialize(value)
        @hasher = Digest::MD5.new
        @value = value
      end

      def generate
        @hasher << begin
          Marshal.dump(@value)
        rescue TypeError
          @value.object_id.to_s
        end
        @hasher.hexdigest
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flipflop-2.8.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.7.1 lib/flipflop/strategies/options_hasher.rb
flipflop-2.7.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.6.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.5.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.4.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.3.1 lib/flipflop/strategies/options_hasher.rb
flipflop-2.3.0 lib/flipflop/strategies/options_hasher.rb
flipflop-2.2.1 lib/flipflop/strategies/options_hasher.rb
flipflop-2.2.0 lib/flipflop/strategies/options_hasher.rb