Class: Alchemy::Admin::ProductSelect
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Alchemy::Admin::ProductSelect
- Defined in:
- app/components/alchemy/admin/product_select.rb
Constant Summary collapse
- VALUE_ATTRIBUTES =
%i[id slug].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
-
#product ⇒ Object
readonly
Returns the value of attribute product.
-
#query_params ⇒ Object
readonly
Returns the value of attribute query_params.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(api_key, product: nil, url: nil, query_params: nil, placeholder: nil, value_attribute: nil) ⇒ ProductSelect
constructor
A new instance of ProductSelect.
Constructor Details
#initialize(api_key, product: nil, url: nil, query_params: nil, placeholder: nil, value_attribute: nil) ⇒ ProductSelect
Returns a new instance of ProductSelect.
10 11 12 13 14 15 16 17 |
# File 'app/components/alchemy/admin/product_select.rb', line 10 def initialize(api_key, product: nil, url: nil, query_params: nil, placeholder: nil, value_attribute: nil) @api_key = api_key @product = product @url = url @query_params = query_params @placeholder = placeholder @value_attribute = value_attribute end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'app/components/alchemy/admin/product_select.rb', line 8 def api_key @api_key end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
8 9 10 |
# File 'app/components/alchemy/admin/product_select.rb', line 8 def placeholder @placeholder end |
#product ⇒ Object (readonly)
Returns the value of attribute product.
8 9 10 |
# File 'app/components/alchemy/admin/product_select.rb', line 8 def product @product end |
#query_params ⇒ Object (readonly)
Returns the value of attribute query_params.
8 9 10 |
# File 'app/components/alchemy/admin/product_select.rb', line 8 def query_params @query_params end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'app/components/alchemy/admin/product_select.rb', line 8 def url @url end |
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'app/components/alchemy/admin/product_select.rb', line 19 def call content_tag("alchemy-product-select", content, attributes) end |