lib/kentaa/api/resources/segment.rb in kentaa-api-0.3.2 vs lib/kentaa/api/resources/segment.rb in kentaa-api-0.4.0
- old
+ new
@@ -59,11 +59,11 @@
@banners ||= begin
banners = []
if data[:banners]
data[:banners].each do |banner|
- banners << Kentaa::Api::Resources::Banner.new(config, data: banner)
+ banners << Kentaa::Api::Resources::Banner.new(banner)
end
end
banners
end
@@ -71,12 +71,20 @@
def external_reference
data[:external_reference]
end
- protected
+ def donations
+ @donations ||= Kentaa::Api::Resources::Donations.new(config, segment_id: id)
+ end
- def load_resource(options)
+ def manual_donations
+ @manual_donations ||= Kentaa::Api::Resources::ManualDonations.new(config, segment_id: id)
+ end
+
+ private
+
+ def load_resource
request.get("/segments/#{id}", options)
end
end
end
end