Method: Zold::ThreadPool#to_json

Defined in:
lib/zold/thread_pool.rb

#to_jsonObject

As a hash map



132
133
134
135
136
137
138
139
140
141
# File 'lib/zold/thread_pool.rb', line 132

def to_json
  @threads.map do |t|
    {
      name: t.name,
      status: t.status,
      alive: t.alive?,
      vars: Hash[t.thread_variables.map { |v| [v.to_s, t.thread_variable_get(v)] }]
    }
  end
end