Module: DeepCloneableChecked
- Defined in:
- lib/deep_cloneable_checked.rb,
lib/deep_cloneable_checked/version.rb,
lib/deep_cloneable_checked/utilities.rb,
lib/deep_cloneable_checked/deep_clone_checked.rb
Defined Under Namespace
Modules: DeepCloneChecked
Classes: MissingAssociationError
Constant Summary
collapse
- VERSION =
"1.2.0"
Class Method Summary
collapse
Class Method Details
.options_array_to_hash(options) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/deep_cloneable_checked/utilities.rb', line 13
def self.options_array_to_hash(options)
hash = {}
options.each do |o|
if o.is_a? Hash
hash.deep_merge! o
else
hash[o] = []
end
end
hash
end
|
.options_to_hash(options) ⇒ Object
2
3
4
5
6
7
8
9
10
11
|
# File 'lib/deep_cloneable_checked/utilities.rb', line 2
def self.options_to_hash(options)
case options
when Hash
options
when Array
options_array_to_hash(options)
else
options_array_to_hash([options])
end
end
|