lib/kentaa/api/resources/segment.rb in kentaa-api-0.4.0 vs lib/kentaa/api/resources/segment.rb in kentaa-api-0.5.0
- old
+ new
@@ -9,10 +9,18 @@
class Segment < Resource
def object_key
"Segment_#{id}"
end
+ def parent
+ site
+ end
+
+ def site
+ Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
+ end
+
def site_id
data[:site_id]
end
def subdomain
@@ -77,9 +85,13 @@
@donations ||= Kentaa::Api::Resources::Donations.new(config, segment_id: id)
end
def manual_donations
@manual_donations ||= Kentaa::Api::Resources::ManualDonations.new(config, segment_id: id)
+ end
+
+ def newsletter_subscriptions
+ @newsletter_subscriptions ||= Kentaa::Api::Resources::NewsletterSubscriptions.new(config, segment_id: id)
end
private
def load_resource