Class: ShopifyCLI::Theme::Extension::AppExtension

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/shopify_cli/theme/extension/app_extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ctx, root:, app_id: nil, location: nil, registration_id: nil) ⇒ AppExtension

Returns a new instance of AppExtension.



23
24
25
26
27
28
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 23

def initialize(ctx, root:, app_id: nil, location: nil, registration_id: nil)
  @app_id = app_id
  @location = location
  @registration_id = registration_id
  @root_obj = Root.new(ctx, root: root)
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



11
12
13
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 11

def app_id
  @app_id
end

#locationObject (readonly)

Returns the value of attribute location.



11
12
13
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 11

def location
  @location
end

#registration_idObject (readonly)

Returns the value of attribute registration_id.



11
12
13
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 11

def registration_id
  @registration_id
end

Instance Method Details

#extension_file?(file) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 34

def extension_file?(file)
  extension_files.include?(self[file])
end

#extension_filesObject



30
31
32
# File 'lib/shopify_cli/theme/extension/app_extension.rb', line 30

def extension_files
  (glob(["**/*.liquid", "**/*.json"]) + static_asset_files).uniq
end