sanderjd-bitfields 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bitfields.rb +3 -2
- metadata +1 -1
data/lib/bitfields.rb
CHANGED
@@ -13,8 +13,9 @@ class BitFields
|
|
13
13
|
|
14
14
|
def self.create(template_name, params = {})
|
15
15
|
template_name = symbol_if_string(template_name)
|
16
|
-
|
17
|
-
|
16
|
+
instance = Marshal.load(Marshal.dump(templates[template_name])) # Deep clone
|
17
|
+
params.each_pair { | field_name, value | instance[field_name] = value }
|
18
|
+
instance
|
18
19
|
end
|
19
20
|
|
20
21
|
def self.compose(&block)
|