Class: Flipflop::Strategies::OptionsHasher
- Inherits:
-
Object
- Object
- Flipflop::Strategies::OptionsHasher
- Defined in:
- lib/flipflop/strategies/options_hasher.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(value) ⇒ OptionsHasher
constructor
A new instance of OptionsHasher.
Constructor Details
#initialize(value) ⇒ OptionsHasher
Returns a new instance of OptionsHasher.
6 7 8 9 |
# File 'lib/flipflop/strategies/options_hasher.rb', line 6 def initialize(value) @hasher = Digest::MD5.new @value = value end |
Instance Method Details
#generate ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/flipflop/strategies/options_hasher.rb', line 11 def generate @hasher << begin Marshal.dump(@value) rescue TypeError @value.object_id.to_s end @hasher.hexdigest end |