1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
pub struct Condition {
pub variable: String,
pub value: String,
}
impl Condition {
pub fn is_true(&self, data: &ftd_rt::Map) -> bool {
if let Some(v) = data.get(self.variable.as_str()) {
return v == &self.value;
}
true
}
}