Class: ShopifyCLI::PartnersAPI::AppExtensions::Job

Inherits:
ThreadPool::Job show all
Defined in:
lib/shopify_cli/partners_api/app_extensions/job.rb

Instance Attribute Summary collapse

Attributes inherited from ThreadPool::Job

#error, #interval

Instance Method Summary collapse

Methods inherited from ThreadPool::Job

#call, #error?, #recurring?, #success?

Constructor Details

#initialize(ctx, app, type) ⇒ Job

Returns a new instance of Job.



11
12
13
14
15
16
17
# File 'lib/shopify_cli/partners_api/app_extensions/job.rb', line 11

def initialize(ctx, app, type)
  super()
  @ctx = ctx
  @app = app
  @api_key = @app["apiKey"]
  @type = type
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



9
10
11
# File 'lib/shopify_cli/partners_api/app_extensions/job.rb', line 9

def result
  @result
end

Instance Method Details

#patch_app_with_extensions!Object



24
25
26
# File 'lib/shopify_cli/partners_api/app_extensions/job.rb', line 24

def patch_app_with_extensions!
  @app.merge!(result)
end

#perform!Object



19
20
21
22
# File 'lib/shopify_cli/partners_api/app_extensions/job.rb', line 19

def perform!
  resp = PartnersAPI.query(@ctx, "get_extension_registrations", **params)
  @result = resp&.dig("data", "app") || {}
end