lib/chronicle/etl/loaders/rest_loader.rb in chronicle-etl-0.2.4 vs lib/chronicle/etl/loaders/rest_loader.rb in chronicle-etl-0.3.0
- old
+ new
@@ -3,15 +3,19 @@
require 'json'
module Chronicle
module ETL
class RestLoader < Chronicle::ETL::Loader
+ register_connector do |r|
+ r.description = 'a REST endpoint'
+ end
+
def initialize( options={} )
super(options)
end
def load(record)
- payload = Chronicle::ETL::Utils::JSONAPI.serialize(record)
+ payload = Chronicle::ETL::JSONAPISerializer.serialize(record)
# have the outer data key that json-api expects
payload = { data: payload } unless payload[:data]
uri = URI.parse("#{@options[:hostname]}#{@options[:endpoint]}")