sanderjd-bitfields 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/bitfields.rb +3 -2
  2. metadata +1 -1
@@ -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
- params.each_pair { | field_name, value | templates[template_name][field_name] = value }
17
- templates[template_name]
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanderjd-bitfields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Sanders