module Trailblazer::Activity::Introspect

The Introspect API provides inflections for `Activity` instances. It abstracts internals about circuits and provides a convenient API to third-parties such as tracing, rendering an activity, or finding particular tasks.

Public Class Methods

Graph(*args) click to toggle source
# File lib/trailblazer/activity/introspect.rb, line 68
def self.Graph(*args)
  Graph.new(*args)
end
render_task(proc) click to toggle source
# File lib/trailblazer/activity/introspect.rb, line 72
def self.render_task(proc)
  if proc.is_a?(Method)

    receiver = proc.receiver
    receiver = receiver.is_a?(Class) ? (receiver.name || "#<Class:0x>") : (receiver.name || "#<Module:0x>") #"#<Class:0x>"

    return "#<Method: #{receiver}.#{proc.name}>"
  elsif proc.is_a?(Symbol)
    return proc.to_s
  end

  proc.inspect
end