Sha256: 73e8dfb19661ab8146cf92b16da7d155d0c6eb3dfd900eaf9617b304a82916ec
Contents?: true
Size: 752 Bytes
Versions: 11
Compression:
Stored size: 752 Bytes
Contents
# frozen_string_literal: true module ShopifyCLI module Theme class ThemeAdminAPIThrottler class RequestParser def initialize(requests) @requests = requests end def parse { path: path, method: method, body: JSON.generate({ assets: assets }), } end private def method @requests.sample.method end def path @requests.sample.bulk_path end def assets @requests.map do |request| body = JSON.parse(request.body) body = body.is_a?(Hash) ? body : JSON.parse(body) body["asset"] end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems