Method: Webspicy::Configuration#dup
- Defined in:
- lib/webspicy/configuration.rb
#dup(&bl) ⇒ Object
Duplicates this configuration and yields the block with the new one, if a block is given.
The cloned configuration has all same values as the original but shares nothing with it. Therefore, affecting the new one has no effect on the original.
264 265 266 267 268 269 270 271 272 273 |
# File 'lib/webspicy/configuration.rb', line 264 def dup(&bl) super.tap do |d| d.children = [] d.preconditions = self.preconditions.dup d.postconditions = self.postconditions.dup d. = self..dup d.before_listeners = self.before_listeners.dup yield d if block_given? end end |