Class: Nmg::Type::Process

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

Overview

Define process with all it’s attributes

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#operationsArray[Operation]

Returns the operations attribute.

Returns:

  • (Array[Operation])

    the operations attribute



8
# File 'lib/nmg/type/process.rb', line 8

attribute :operations, Array[Operation]

Class Method Details

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



14
15
16
17
18
19
20
# File 'lib/nmg/type/process.rb', line 14

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

  count.times.map do
    new(operations: Operation.generate(operations, options))
  end
end

Instance Method Details

#to_json(options = {}) ⇒ Object



10
11
12
# File 'lib/nmg/type/process.rb', line 10

def to_json(options = {})
  operations.to_json(options)
end