Class: Viewport::Component
- Inherits:
-
Lookbook::BaseComponent
- Object
- Lookbook::BaseComponent
- Viewport::Component
- Defined in:
- app/components/lookbook/viewport/component.rb
Instance Method Summary collapse
- #generate_id(*args) ⇒ Object
-
#initialize(src:, resize_height: true, resize_width: true, max_height: nil, **html_attrs) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(src:, resize_height: true, resize_width: true, max_height: nil, **html_attrs) ⇒ Component
Returns a new instance of Component.
3 4 5 6 7 8 9 |
# File 'app/components/lookbook/viewport/component.rb', line 3 def initialize(src:, resize_height: true, resize_width: true, max_height: nil, **html_attrs) @src = src @resize_height = resize_height @resize_width = resize_width @max_height = max_height super(**html_attrs) end |
Instance Method Details
#generate_id(*args) ⇒ Object
11 12 13 |
# File 'app/components/lookbook/viewport/component.rb', line 11 def generate_id(*args) args.map { |args| args.delete_prefix("/").tr("&?=/_\-", "-") }.join("-") end |