Method: VagrantCloud::Data::Mutable.load

Defined in:
lib/vagrant_cloud/data.rb

.load(options = {}) ⇒ Mutable

Load data and create a new instance



202
203
204
205
206
207
208
209
210
211
212
# File 'lib/vagrant_cloud/data.rb', line 202

def self.load(options={})
  opts = {}.tap do |o|
    (attr_required + attr_optional +
      self.instance_method(:initialize).parameters.find_all { |i|
      i.first == :key || i.first == :keyreq
    }.map(&:last)).each do |k|
      o[k.to_sym] = options[k.to_sym]
    end
  end
  self.new(**opts)
end