Class: SolidusAdmin::Orders::Show::Adjustments::Index::Adjustable::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::Orders::Show::Adjustments::Index::Adjustable::Component
- Defined in:
- app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb
Direct Known Subclasses
SpreeLineItem::Component, SpreeOrder::Component, SpreeShipment::Component
Instance Attribute Summary collapse
-
#adjustable ⇒ Object
readonly
Returns the value of attribute adjustable.
-
#adjustment ⇒ Object
readonly
Returns the value of attribute adjustment.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
Instance Method Summary collapse
- #call ⇒ Object
- #caption ⇒ Object
- #detail ⇒ Object
-
#initialize(adjustment) ⇒ Component
constructor
A new instance of Component.
- #thumbnail ⇒ Object
Constructor Details
#initialize(adjustment) ⇒ Component
Returns a new instance of Component.
6 7 8 9 10 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 6 def initialize(adjustment) @adjustment = adjustment @adjustable = adjustment.adjustable @model_name = adjustable&.model_name&.human end |
Instance Attribute Details
#adjustable ⇒ Object (readonly)
Returns the value of attribute adjustable.
4 5 6 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 4 def adjustable @adjustable end |
#adjustment ⇒ Object (readonly)
Returns the value of attribute adjustment.
4 5 6 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 4 def adjustment @adjustment end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
4 5 6 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 4 def model_name @model_name end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 12 def call render component("ui/thumbnail_with_caption").new(caption:, detail:) do thumbnail end end |
#caption ⇒ Object
22 23 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 22 def end |
#detail ⇒ Object
25 26 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 25 def detail end |
#thumbnail ⇒ Object
18 19 20 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb', line 18 def thumbnail render(component("ui/thumbnail").for(adjustment.adjustable, class: "basis-10")) end |