Module: Granite::Action::Preconditions::ClassMethods
- Defined in:
- lib/granite/action/preconditions.rb
Instance Method Summary collapse
-
#precondition(*args, &block) ⇒ Object
Define preconditions for current action.
Instance Method Details
#precondition(*args, &block) ⇒ Object
Define preconditions for current action.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/granite/action/preconditions.rb', line 47 def precondition(*args, &block) = args. if block add_precondition(BasePrecondition, , &block) elsif args.first.is_a?(Class) add_precondition(ObjectPrecondition, *args, ) else add_preconditions_hash(*args, **) end end |