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, 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 =
Colors.
%w[primary secondary success danger warning info light dark].freeze
- DEFAULT_COLOR =
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)
17 18 19 20 21 22 23 |
# File 'app/components/railsboot/component.rb', line 17 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)
11 12 13 14 15 |
# File 'app/components/railsboot/component.rb', line 11 def fetch_or_raise(argument, constant) raise ArgumentError, "The `#{argument}: #{argument}` argument is not valid, allowed options are #{constant.join(', ')}." unless argument.present? && constant.include?(argument.to_s) argument end |