Class: CloneKit::Rules::Except
- Inherits:
-
CloneKit::Rule
- Object
- CloneKit::Rule
- CloneKit::Rules::Except
- Defined in:
- lib/clone_kit/rules/except.rb
Overview
Removes attributes defined by an array of keys
Instance Attribute Summary
Attributes inherited from CloneKit::Rule
Instance Method Summary collapse
- #fix(_old_id, attributes) ⇒ Object
-
#initialize(*excepted_attributes) ⇒ Except
constructor
A new instance of Except.
Constructor Details
#initialize(*excepted_attributes) ⇒ Except
9 10 11 |
# File 'lib/clone_kit/rules/except.rb', line 9 def initialize(*excepted_attributes) self.excepted_attributes = excepted_attributes end |
Instance Method Details
#fix(_old_id, attributes) ⇒ Object
13 14 15 16 17 |
# File 'lib/clone_kit/rules/except.rb', line 13 def fix(_old_id, attributes) excepted_attributes.each do |key| attributes.delete(key) end end |