Class: Protos::Component

Inherits:
Phlex::HTML
  • Object
show all
Defined in:
lib/protos/component.rb

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Component

Adds non-defined options to the html_options hash



17
18
19
20
21
22
# File 'lib/protos/component.rb', line 17

def initialize(*, **kwargs, &)
  super
  defined_keys = self.class.dry_initializer.definitions.keys
  extra_keys = kwargs.keys - defined_keys
  @html_options = kwargs.slice(*extra_keys)
end