Module: VagrantPlugins::Dotvm::Injector::AbstractInjector
- Included in:
- AuthorizedKey, Host, Instance, Machine, Network, Project, Provision, Route, SharedFolder
- Defined in:
- lib/vagrant-dotvm/injector/abstractinjector.rb
Overview
Helper functions used by injectors
Class Method Summary collapse
-
.generate_hash(source, options) ⇒ Hash
Extracts specified
optionsfromsourceand return them as hash. -
.rewrite_options(source, target, options) ⇒ Object
Rewrite
optionsfromsourcetotarget.
Class Method Details
.generate_hash(source, options) ⇒ Hash
Extracts specified options from source and return them as hash.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-dotvm/injector/abstractinjector.rb', line 13 def generate_hash(source, ) hash = {} .each do |opt| val = source.send(opt) hash[opt] = val unless val.nil? end hash end |
.rewrite_options(source, target, options) ⇒ Object
Rewrite options from source to target.
29 30 31 32 33 34 |
# File 'lib/vagrant-dotvm/injector/abstractinjector.rb', line 29 def (source, target, ) .each do |opt| val = source.send(opt) target.send("#{opt}=", val) unless val.nil? end end |