Class: Alchemy::Admin::VariantSelect

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/variant_select.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, variant: nil, url: nil, query_params: nil, placeholder: nil) ⇒ VariantSelect

Returns a new instance of VariantSelect.



8
9
10
11
12
13
14
# File 'app/components/alchemy/admin/variant_select.rb', line 8

def initialize(api_key, variant: nil, url: nil, query_params: nil, placeholder: nil)
  @api_key = api_key
  @variant = variant
  @url = url
  @query_params = query_params
  @placeholder = placeholder
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



6
7
8
# File 'app/components/alchemy/admin/variant_select.rb', line 6

def api_key
  @api_key
end

#placeholderObject (readonly)

Returns the value of attribute placeholder.



6
7
8
# File 'app/components/alchemy/admin/variant_select.rb', line 6

def placeholder
  @placeholder
end

#query_paramsObject (readonly)

Returns the value of attribute query_params.



6
7
8
# File 'app/components/alchemy/admin/variant_select.rb', line 6

def query_params
  @query_params
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'app/components/alchemy/admin/variant_select.rb', line 6

def url
  @url
end

#variantObject (readonly)

Returns the value of attribute variant.



6
7
8
# File 'app/components/alchemy/admin/variant_select.rb', line 6

def variant
  @variant
end

Instance Method Details

#callObject



16
17
18
# File 'app/components/alchemy/admin/variant_select.rb', line 16

def call
  ("alchemy-variant-select", content, attributes)
end