<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_rulegroup(self, rulegroup):
 """Adds a rulegroup to this segment."""

        body = rulegroup
        response = self._post("/segments/%s/rules.json" %
                              self.segment_id, json.dumps(body))