Skip to content

Commit

Permalink
Improved pyauditor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-k committed Feb 23, 2023
1 parent 331f426 commit e9790cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pyauditor/src/domain/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,23 @@ impl Meta {
}
}

/// insert(key: str, value: [str])
/// Insert a key-value pair into Meta
///
/// :param key: Key
/// :type key: str
/// :param value: Value
/// :type value: [str]
fn insert(mut self_: PyRefMut<Self>, key: String, value: Vec<String>) -> PyRefMut<Self> {
self_.inner.insert(key, value);
self_
}

/// get(key: str)
/// Returns a list of string values matching the given key
///
/// :param key: Key to get
/// :type key: str
fn get(&self, key: String) -> Option<Vec<String>> {
self.inner.get(&key).cloned()
}
Expand Down
4 changes: 2 additions & 2 deletions pyauditor/src/domain/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ impl Record {
.map(|components| components.iter().cloned().map(Component::from).collect())
}

/// Returns the meta dict
/// Returns the meta object
///
/// Returns None if no meta is available, otherwise returns a dict of meta information.
/// Returns None if no meta is available, otherwise returns a meta object.
#[getter]
fn meta(&self) -> Option<Meta> {
self.inner.meta.clone().map(Meta::from)
Expand Down

0 comments on commit e9790cc

Please sign in to comment.