Class: Alchemy::Admin::ProductSelect

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, product: nil, url: nil, query_params: nil) ⇒ ProductSelect

Returns a new instance of ProductSelect.



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

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

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

#productObject (readonly)

Returns the value of attribute product.



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

def product
  @product
end

#query_paramsObject (readonly)

Returns the value of attribute query_params.



6
7
8
# File 'app/components/alchemy/admin/product_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/product_select.rb', line 6

def url
  @url
end

Instance Method Details

#callObject



15
16
17
# File 'app/components/alchemy/admin/product_select.rb', line 15

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