Class: ShopifyCLI::Theme::Extension::AppExtension
- Inherits:
-
Object
- Object
- ShopifyCLI::Theme::Extension::AppExtension
- Extended by:
- Forwardable
- Defined in:
- lib/shopify_cli/theme/extension/app_extension.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#registration_id ⇒ Object
readonly
Returns the value of attribute registration_id.
Instance Method Summary collapse
- #extension_file?(file) ⇒ Boolean
- #extension_files ⇒ Object
-
#initialize(ctx, root:, app_id: nil, location: nil, registration_id: nil) ⇒ AppExtension
constructor
A new instance of AppExtension.
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_id ⇒ Object (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 |
#location ⇒ Object (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_id ⇒ Object (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
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_files ⇒ Object
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 |