func (m *MonitorDefinition) ToMonitor() (*Monitor, error) {
	var rules []*Rule

	for _, ruleDef := range m.Rules {
		rObj, err := ruleDef.ToRule()
		if err != nil {
			return nil, err
		}

		rules = append(rules, rObj)
	}

	return NewMonitor(m.RootDirectory, rules, m.Recursive, m.CheckFrequencySeconds)
}
// ToMonitor converts a monitor definition to a monitor object.
ToMonitor converts a monitor definition to a monitor object.
// ToMonitor converts a monitor definition to a monitor object .
func (m *MonitorDefinition) ToMonitor() (*Monitor, error) {
	var rules []*Rule
	for _, ruleDef := range m.Rules {
		rObj, err := ruleDef.ToRule()
		if err != nil {
			return nil, err
		}
		rules = append(rules, rObj)
	}
	return NewMonitor(m.RootDirectory, rules, m.Recursive, m.CheckFrequencySeconds)
}
func ( m * MonitorDefinition ) ToMonitor ( ) ( * Monitor , error ) { var rules [ ] * Rule for _ , ruleDef := range m . Rules { rObj , err := ruleDef . ToRule ( ) if err != nil { return nil , err } rules = append ( rules , rObj ) } return NewMonitor ( m . RootDirectory , rules , m . Recursive , m . CheckFrequencySeconds ) }
ToMonitor converts a monitor definition to a monitor object.
ToMonitor converts a monitor definition to a monitor object .