Module: Phlex::Sorbet::InstanceMethods
- Extended by:
- T::Sig
- Defined in:
- lib/phlex/sorbet/instance_methods.rb
Overview
Instance methods prepended into components that include Phlex::Sorbet. Wraps ‘initialize` to build a typed Props struct from incoming kwargs and exposes it via the `props` accessor.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Object
Builds typed props, then calls super so the Phlex base class can initialize as usual.
- #props ⇒ Object
Instance Method Details
#initialize(**kwargs) ⇒ Object
Builds typed props, then calls super so the Phlex base class can initialize as usual.
19 20 21 22 |
# File 'lib/phlex/sorbet/instance_methods.rb', line 19 def initialize(**kwargs, &) @props = self.class.build_props(**kwargs) super(&) end |
#props ⇒ Object
28 29 30 |
# File 'lib/phlex/sorbet/instance_methods.rb', line 28 def props @props end |