Skip to content

Commit

Permalink
Adding new has_key_for? method to params (#500)
Browse files Browse the repository at this point in the history
* Adding new has_key_for? method to params. Fixes #72

* Consolidate this method since its implementation is always the same.
  • Loading branch information
jwoertink authored Oct 23, 2020
1 parent dddcf7d commit 2a0cd36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/avram/paramable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ module Avram::Paramable
abstract def nested(key : String) : Hash(String, String)
abstract def get?(key : String)
abstract def get(key : String)

def has_key_for?(operation : Avram::Operation.class | Avram::SaveOperation.class) : Bool
nested?(operation.param_key).any?
end
end

0 comments on commit 2a0cd36

Please sign in to comment.