class Macros::Ctx::Inspect

Prints the entire tbl context or just a single resource

@example prints the entire tbl context

step Macros::Ctx::Inspect()

@example prints the :model resource from the tbl context

step Macros::Ctx::Inspect(key: :model)

Public Class Methods

new(key: nil) click to toggle source

@return [Macros::Debug::Ctx] step macro instance @param key [Symbol or String] ctx key under which is a resource to which we want to assign, optional

# File lib/macros/ctx/inspect.rb, line 15
def initialize(key: nil)
  @key = key
end

Public Instance Methods

call(ctx, **) click to toggle source
# File lib/macros/ctx/inspect.rb, line 19
def call(ctx, **)
  if @key
    p ctx[@key]
  else
    p ctx
  end
end