Class: Macros::Ctx::Inspect
Overview
Prints the entire tbl context or just a single resource
Instance Method Summary collapse
- #call(ctx) ⇒ Object
-
#initialize(key: nil) ⇒ Macros::Debug::Ctx
constructor
Step macro instance.
Methods inherited from Base
Constructor Details
#initialize(key: nil) ⇒ Macros::Debug::Ctx
Returns step macro instance.
15 16 17 |
# File 'lib/macros/ctx/inspect.rb', line 15 def initialize(key: nil) @key = key end |
Instance Method Details
#call(ctx) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/macros/ctx/inspect.rb', line 19 def call(ctx, **) if @key p ctx[@key] else p ctx end end |