The capacity of a class of multi-way relay channels, where L users communicate via a relay (at possibly different rates), is derived for the case where the channel outputs are modular sums of the channel inputs and the receiver noise. The cut-set upper bound to the capacity is shown to be achievable. More specifically, the capacity is achieved using (i) rate splitting, (ii) functional-decode-forward, and (iii) joint source-channel coding. We note that while separate source-channel coding can achieve the common-rate capacity, joint source-channel coding is used to achieve the capacity for the general case where the users are transmitting at different rates.