Class: Macros::Ctx::ValidatePresence
- Defined in:
- lib/macros/ctx/validate_presence.rb
Instance Method Summary collapse
- #call(ctx) ⇒ Object
-
#initialize(key) ⇒ ValidatePresence
constructor
Check if the key set in the context.
Methods inherited from Base
Constructor Details
#initialize(key) ⇒ ValidatePresence
Check if the key set in the context
10 11 12 |
# File 'lib/macros/ctx/validate_presence.rb', line 10 def initialize(key) @key = key end |
Instance Method Details
#call(ctx) ⇒ Object
15 16 17 |
# File 'lib/macros/ctx/validate_presence.rb', line 15 def call(ctx, **) !!ctx[@key] end |