Sha256: 5d42d45d057e5e633957b2a797dc1a4cf91f274b0dfce1fe4505f078c428abd2

Contents?: true

Size: 367 Bytes

Versions: 11

Compression:

Stored size: 367 Bytes

Contents

module Lurker
  module Json
    class Orderer
      EXTENSIONS = 'extensions'.freeze

      class << self
        def reorder(schema)
          new.reorder(schema)
        end
      end

      def reorder(schema)
        extensions = schema.delete(EXTENSIONS).try(:reorder!)
        schema.reorder!
        schema[EXTENSIONS] = extensions
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lurker-1.0.0 lib/lurker/json/orderer.rb
lurker-0.6.12 lib/lurker/json/orderer.rb
lurker-0.6.11 lib/lurker/json/orderer.rb
lurker-0.6.10 lib/lurker/json/orderer.rb
lurker-0.6.9 lib/lurker/json/orderer.rb
lurker-0.6.8 lib/lurker/json/orderer.rb
lurker-0.6.7 lib/lurker/json/orderer.rb
lurker-0.6.6 lib/lurker/json/orderer.rb
lurker-0.6.5 lib/lurker/json/orderer.rb
lurker-0.6.4 lib/lurker/json/orderer.rb
lurker-0.6.3 lib/lurker/json/orderer.rb