Method: HaveAPI::Fs::Factory.replace
- Defined in:
- lib/haveapi/fs/factory.rb
.replace(*args) ⇒ Object
Replace a component class by a different class. This method has two forms. Either call it with a hash of replacements or with two arguments, where the first is the class to be replaced and the second the class to replace it with.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/haveapi/fs/factory.rb', line 15 def replace(*args) @replacements ||= {} if args.size == 2 @replacements[args[0]] = args[1] else @replacements.update(args.first) end end |