pub const READ_FITTINGS: &str = "esi-fittings.read_fittings.v1";
pub const WRITE_FITTINGS: &str = "esi-fittings.write_fittings.v1";
pub struct FittingsScopes {
pub(super) scopes: Vec<String>,
}
impl Default for FittingsScopes {
fn default() -> Self {
Self::new()
}
}
impl FittingsScopes {
pub fn new() -> Self {
FittingsScopes { scopes: Vec::new() }
}
pub fn all() -> Self {
FittingsScopes::new().read_fittings().write_fittings()
}
pub fn read_fittings(mut self) -> Self {
self.scopes.push(READ_FITTINGS.to_string());
self
}
pub fn write_fittings(mut self) -> Self {
self.scopes.push(WRITE_FITTINGS.to_string());
self
}
}
#[cfg(test)]
mod fittings_scopes_tests {
use crate::scope::FittingsScopes;
#[test]
fn test_fittings_scopes_default() {
let fittings_scopes = FittingsScopes::default();
assert_eq!(fittings_scopes.scopes.len(), 0)
}
}