Sha256: 040e67fa93eb26b73671dc5d27cc06e8e3d355e9db0c37dd6d8e03e7927e6978

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

# frozen_string_literal: true

module Metatron
  # Used for "normal" sync requests
  class SyncController < Controller
    options "/" do
      headers "Access-Control-Allow-Methods" => ["POST"]
      halt 200
    end

    post "/" do
      data = sync
      data[:children] = data[:children]&.map { |c| c.respond_to?(:render) ? c.render : c }
      halt(data.to_json)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
metatron-0.3.0 lib/metatron/sync_controller.rb
metatron-0.2.8 lib/metatron/sync_controller.rb
metatron-0.2.7 lib/metatron/sync_controller.rb
metatron-0.2.6 lib/metatron/sync_controller.rb
metatron-0.2.5 lib/metatron/sync_controller.rb
metatron-0.2.4 lib/metatron/sync_controller.rb
metatron-0.2.3 lib/metatron/sync_controller.rb
metatron-0.2.2 lib/metatron/sync_controller.rb
metatron-0.2.1 lib/metatron/sync_controller.rb
metatron-0.2.0 lib/metatron/sync_controller.rb