Class: Nmg::Type::Process
Overview
Define process with all it’s attributes
Instance Attribute Summary collapse
-
#operations ⇒ Array[Integer]
The operations attribute.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#operations ⇒ Array[Integer]
Returns the operations attribute.
8 |
# File 'lib/nmg/type/process.rb', line 8 attribute :operations, Array[Integer] |
Class Method Details
.generate(count, options = {}, gen = Random.new) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/nmg/type/process.rb', line 14 def self.generate(count, = {}, gen = Random.new) = {operations: 3, min: 1, max: 20}.merge() operations = [:operations] range = ([:min]..[:max]) count.times.map do new(operations: operations.times.map { gen.rand(range) }) end end |
Instance Method Details
#to_json(options = {}) ⇒ Object
10 11 12 |
# File 'lib/nmg/type/process.rb', line 10 def to_json( = {}) operations.to_json() end |