class MailchimpAPI::Segment
Public Instance Methods
members(params = {})
click to toggle source
The path to get segment members is '/3.0/lists/:list_id/segments/:segment_id/members' Unfortunately, ActiveResource
does not support nested resources, only single parent resources:
Using a has_many, there is no way to include the `list_id`, so we just create our own members method.
# File lib/mailchimp_api/resources/segment.rb, line 19 def members(params = {}) @members ||= MailchimpAPI::SegmentMember.find(:all, params: { segment_id: id }.deep_merge(prefix_options).deep_merge(params)) end