Class: Protos::Component
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Protos::Component
- Extended by:
- Dry::Core::ClassAttributes
- Defined in:
- lib/protos/component.rb
Direct Known Subclasses
Accordion, Accordion::Item, Alert, Alert::Actions, Alert::Icon, Avatar, Badge, Breadcrumbs, Breadcrumbs::Crumb, Card, Protos::Card::Actions, Protos::Card::Body, Protos::Card::Image, Protos::Card::Title, Carousel, Protos::Carousel::Actions, Protos::Carousel::Item, ChatBubble, Protos::ChatBubble::Content, Protos::ChatBubble::Footer, Protos::ChatBubble::Header, Protos::ChatBubble::Image, Collapse, Protos::Collapse::Content, Protos::Collapse::Title, Command, Protos::Command::Empty, Protos::Command::Group, Protos::Command::Input, Protos::Command::Item, Protos::Command::List, Protos::Command::Title, Protos::Command::Trigger, Drawer, Drawer::Content, Drawer::Side, Drawer::Trigger, Dropdown::Item, Hero, Hero::Content, Hero::Overlay, List, List::Item, Modal, Modal::CloseButton, Modal::Dialog, Modal::Trigger, Popover, Popover::Content, Popover::Trigger, Stats, Stats::Actions, Stats::Description, Stats::Figure, Stats::Stat, Stats::Title, Stats::Value, Steps, Steps::Step, Swap, Swap::Off, Swap::On, Table, Table::Body, Table::Caption, Table::Cell, Table::Footer, Table::Head, Table::Header, Table::Row, Tabs, Tabs::Tab, Timeline, Timeline::Center, Timeline::Item, Timeline::Left, Timeline::Right, Toast, Toast::CloseButton, Typography::Heading, Typography::InlineLink, Typography::Paragraph
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Component
constructor
Adds non-defined options to the html_options hash.
Constructor Details
#initialize(**kwargs) ⇒ Component
Adds non-defined options to the html_options hash
30 31 32 33 34 35 36 37 38 |
# File 'lib/protos/component.rb', line 30 def initialize(*, **kwargs, &) defined_keys = self.class.dry_initializer.definitions.keys defined, undefined = kwargs .partition { |key, _| defined_keys.include?(key) } .map!(&:to_h) super(*, html_options: undefined, **defined, &) end |