Class: SolidusAdmin::Orders::Show::Adjustments::Index::Source::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::Orders::Show::Adjustments::Index::Source::Component
- Defined in:
- app/components/solidus_admin/orders/show/adjustments/index/source/component.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#adjustment ⇒ Object
readonly
Returns the value of attribute adjustment.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #call ⇒ Object
- #caption ⇒ Object
- #detail ⇒ Object
- #icon ⇒ Object
-
#initialize(adjustment) ⇒ Component
constructor
A new instance of Component.
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/source/component.rb', line 6 def initialize(adjustment) @adjustment = adjustment @source = adjustment.source @model_name = source&.model_name&.human end |
Instance Attribute Details
#adjustment ⇒ Object (readonly)
Returns the value of attribute adjustment.
4 5 6 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/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/source/component.rb', line 4 def model_name @model_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/component.rb', line 4 def source @source end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/component.rb', line 12 def call render component("ui/thumbnail_with_caption").new(icon:, caption:, detail:) end |
#caption ⇒ Object
16 17 18 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/component.rb', line 16 def adjustment.label end |
#detail ⇒ Object
20 21 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/component.rb', line 20 def detail end |
#icon ⇒ Object
23 24 25 |
# File 'app/components/solidus_admin/orders/show/adjustments/index/source/component.rb', line 23 def icon "question-line" end |