Class: Macros::VerifyParams::Date
- Defined in:
- lib/macros/verify_params/date.rb
Instance Method Summary collapse
- #call(ctx) ⇒ Object
-
#initialize(params_key: :date) ⇒ Date
constructor
A new instance of Date.
Methods inherited from Base
Constructor Details
#initialize(params_key: :date) ⇒ Date
Returns a new instance of Date.
6 7 8 |
# File 'lib/macros/verify_params/date.rb', line 6 def initialize(params_key: :date) @params_key = params_key end |
Instance Method Details
#call(ctx) ⇒ Object
10 11 12 13 14 |
# File 'lib/macros/verify_params/date.rb', line 10 def call(ctx, **) return false unless ctx[:params] ctx[:params][@params_key].class == ::Date end |