Module: Mutant::Helper
- Defined in:
- lib/mutant/helper.rb
Overview
Module for support methods
They would normally be defined on the root namespace. But it is easier to create the Zombie when there are no References to the root namespace name within the library.
Class Method Summary collapse
-
.deep_clone(object) ⇒ Object
private
Return deep clone of object.
-
.extract_option(options, key) ⇒ Object
private
Extract option from options hash.
Class Method Details
.deep_clone(object) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return deep clone of object
18 19 20 |
# File 'lib/mutant/helper.rb', line 18 def self.deep_clone(object) Marshal.load(Marshal.dump(object)) end |
.extract_option(options, key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extract option from options hash
31 32 33 34 35 |
# File 'lib/mutant/helper.rb', line 31 def self.extract_option(, key) .fetch(key) do raise ArgumentError,"Missing #{key.inspect} in options" end end |