Class: ShopifyCLI::Theme::Extension::DevServer::ProxyParamBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb', line 11

def build
  # Core doesn't support replace_extension_templates
  return {} if core?(current_path)

  (request_templates + syncer_templates)
    .select(&:liquid?)
    .uniq(&:relative_path)
    .reject { |file| proxy_cannot_render?(file) }
    .map { |file| as_param(file) }
    .to_h
end

#with_core_endpoints(core_endpoints) ⇒ Object



23
24
25
26
# File 'lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb', line 23

def with_core_endpoints(core_endpoints)
  @core_endpoints = core_endpoints
  self
end

#with_extension(extension) ⇒ Object



38
39
40
41
# File 'lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb', line 38

def with_extension(extension)
  @extension = extension
  self
end

#with_rack_env(rack_env) ⇒ Object



33
34
35
36
# File 'lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb', line 33

def with_rack_env(rack_env)
  @rack_env = rack_env
  self
end

#with_syncer(syncer) ⇒ Object



28
29
30
31
# File 'lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb', line 28

def with_syncer(syncer)
  @syncer = syncer
  self
end