class Macros::Ctx::ValidatePresence
Public Class Methods
new(key)
click to toggle source
Check if the key set in the context @param key [Symbol] @example key not passed
Macros::Contract::ExtractParams()
# File lib/macros/ctx/validate_presence.rb, line 10 def initialize(key) @key = key end
Public Instance Methods
call(ctx, **)
click to toggle source
@param ctx [Trailblazer::Skill] tbl context hash
# File lib/macros/ctx/validate_presence.rb, line 15 def call(ctx, **) !!ctx[@key] end