lib/kentaa/api/clients/segments.rb in kentaa-api-0.2.1 vs lib/kentaa/api/clients/segments.rb in kentaa-api-0.3.0
- old
+ new
@@ -5,16 +5,16 @@
module Clients
class Segments < Base
include Kentaa::Api::Clients::All
def list(options = {})
- response = request.get("/segments", options)
- Kentaa::Api::Resources::Segments.new(config, response)
+ segments = Kentaa::Api::Resources::Segments.new(config, options)
+ segments.load
end
- def get(id)
- response = request.get("/segments/#{id}")
- Kentaa::Api::Resources::Segment.new(config, response)
+ def get(id, options = {})
+ segment = Kentaa::Api::Resources::Segment.new(config, options.merge(id: id))
+ segment.load
end
end
end
end
end