Class: Railsboot::Component
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Railsboot::Component
- Defined in:
- app/components/railsboot/component.rb
Overview
parent class for all RailsbootUI related components
Direct Known Subclasses
Accordion::ItemComponent, AccordionComponent, AlertComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BaseComponent, BlankSlateComponent, Breadcrumb::ItemComponent, BreadcrumbComponent, CalloutComponent, CardComponent, CloseButtonComponent, ContainerComponent, CopyToClipboardComponent, DividerComponent, Dropdown::ActionComponent, Dropdown::DividerComponent, Dropdown::HeaderComponent, Dropdown::LinkComponent, DropdownComponent, ErrorsComponent, FlashComponent, FormField::CaptionComponent, FormField::FieldComponent, FormField::LabelComponent, FormField::ValidationComponent, FormFieldComponent, HeadingComponent, ListGroup::ItemComponent, ListGroupComponent, Modal::BodyComponent, Modal::FooterComponent, Modal::HeaderComponent, ModalComponent, Nav::ItemComponent, NavComponent, Navbar::BrandComponent, Navbar::NavComponent, Navbar::TogglerComponent, NavbarComponent, Offcanvas::BodyComponent, Offcanvas::HeaderComponent, OffcanvasComponent, PaginationComponent, PricingPanelComponent, ProgressCircularComponent, ProgressComponent, RatingGroupComponent, RatingGroupComponent::BackgroundIconComponent, RatingGroupComponent::FillIconComponent, RibbonComponent, SpinnerComponent, StatComponent, Stepper::ItemComponent, StepperComponent, Table::BodyComponent, Table::CellComponent, Table::HeadComponent, Table::RowComponent, TableComponent, TeamMemberComponent, Toast::BodyComponent, Toast::HeaderComponent, ToastComponent, Www::VideoCardComponent
Constant Summary collapse
- COLORS =
["primary", "secondary", "success", "danger", "warning", "info", "light", "dark"].freeze
- DEFAULT_COLOR =
"primary".freeze
Instance Method Summary collapse
- #fetch_or_fallback(argument, constant, fallback) ⇒ Object protected
- #fetch_or_raise(argument, constant) ⇒ Object protected
Instance Method Details
#fetch_or_fallback(argument, constant, fallback) ⇒ Object (protected)
16 17 18 19 20 21 22 |
# File 'app/components/railsboot/component.rb', line 16 def fetch_or_fallback(argument, constant, fallback) if argument.present? && constant.include?(argument.to_s) argument else fallback end end |
#fetch_or_raise(argument, constant) ⇒ Object (protected)
8 9 10 11 12 13 14 |
# File 'app/components/railsboot/component.rb', line 8 def fetch_or_raise(argument, constant) if argument.present? && constant.include?(argument.to_s) argument else raise ArgumentError, "The `#{argument}: #{argument}` argument is not valid, allowed options are #{constant.join(", ")}." end end |