Class: ViewComponent::Storybook::MethodArgs::ComponentConstructorArgs
- Inherits:
-
ControlMethodArgs
- Object
- MethodArgs
- ControlMethodArgs
- ViewComponent::Storybook::MethodArgs::ComponentConstructorArgs
- Defined in:
- lib/view_component/storybook/method_args/component_constructor_args.rb
Overview
Class representing the constructor args for a Component
Instance Attribute Summary
Attributes inherited from ControlMethodArgs
Attributes inherited from MethodArgs
#args, #kwargs, #target_method, #target_method_params_names
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(component_class, *args, **kwargs) ⇒ ComponentConstructorArgs
constructor
A new instance of ComponentConstructorArgs.
Methods inherited from ControlMethodArgs
#call, #controls, #resolve_method_args, #with_param_prefix
Constructor Details
#initialize(component_class, *args, **kwargs) ⇒ ComponentConstructorArgs
Returns a new instance of ComponentConstructorArgs.
17 18 19 |
# File 'lib/view_component/storybook/method_args/component_constructor_args.rb', line 17 def initialize(component_class, *args, **kwargs) super(component_class.instance_method(:initialize), *args, **kwargs) end |
Class Method Details
.from_component_class(component_class, *args, **kwargs) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/view_component/storybook/method_args/component_constructor_args.rb', line 9 def self.from_component_class(component_class, *args, **kwargs) if DryInitializerComponentConstructorArgs.dry_initialize?(component_class) DryInitializerComponentConstructorArgs.new(component_class, *args, **kwargs) else new(component_class, *args, **kwargs) end end |