func (r *RuleDefinition) ToRule() (*Rule, error) {
	cond, err := ParseCondition(r.Condition)
	if err != nil {
		return nil, err
	}

	action, err := r.Action.ToAction()
	if err != nil {
		return nil, err
	}

	return &Rule{
		Name:      r.Name,
		Condition: cond,
		Action:    action,
	}, nil
}
// ToRule converts the rule def to a rule object.
ToRule converts the rule def to a rule object.
// ToRule converts the rule def to a rule object .
func (r *RuleDefinition) ToRule() (*Rule, error) {
	cond, err := ParseCondition(r.Condition)
	if err != nil {
		return nil, err
	}
	action, err := r.Action.ToAction()
	if err != nil {
		return nil, err
	}
	return &Rule{
		Name:      r.Name,
		Condition: cond,
		Action:    action,
	}, nil
}
func ( r * RuleDefinition ) ToRule ( ) ( * Rule , error ) { cond , err := ParseCondition ( r . Condition ) if err != nil { return nil , err } action , err := r . Action . ToAction ( ) if err != nil { return nil , err } return & Rule { Name : r . Name , Condition : cond , Action : action , } , nil }
ToRule converts the rule def to a rule object.
ToRule converts the rule def to a rule object .