-
- private
-
- def with_message_limit(value)
- max_messages_per_hour = Object.send("remove_const", "MAX_MESSAGES_PER_HOUR")
- Object.const_set("MAX_MESSAGES_PER_HOUR", value)
-
- yield
-
- Object.send("remove_const", "MAX_MESSAGES_PER_HOUR")
- Object.const_set("MAX_MESSAGES_PER_HOUR", max_messages_per_hour)
- end