We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97b44f6 commit c549631Copy full SHA for c549631
1 file changed
aries_cloudagent/messaging/models/base_record.py
@@ -498,6 +498,24 @@ def __eq__(self, other: Any) -> bool:
498
return self.value == other.value and self.tags == other.tags
499
return False
500
501
+ @classmethod
502
+ def get_attributes_by_prefix(cls, prefix: str, walk_mro: bool = True):
503
+ """
504
+ List all values for attributes with common prefix.
505
+
506
+ Args:
507
+ prefix: Common prefix to look for
508
+ walk_mro: Walk MRO to find attributes inherited from superclasses
509
510
511
+ bases = cls.__mro__ if walk_mro else [cls]
512
+ return [
513
+ vars(base)[name]
514
+ for base in bases
515
+ for name in vars(base)
516
+ if name.startswith(prefix)
517
+ ]
518
519
520
class BaseExchangeRecord(BaseRecord):
521
"""Represents a base record with event tracing capability."""
0 commit comments