Class: Nmg::Type::Machine

Inherits:
Base
  • Object
show all
Defined in:
lib/nmg/type/machine.rb

Class Method Summary collapse

Methods inherited from Base

#to_json

Class Method Details

.generate(count, options = {}, gen = Random.new) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/nmg/type/machine.rb', line 6

def self.generate(count, options = {}, gen = Random.new)
  maintenances_count = options[:maintenances_count]

  count.times.map do
    new(maintenances: Maintenance.generate(maintenances_count,
                                           options[:maintenances] || {},
                                           gen))
  end
end