Class: Avo::Index::Ordering::ButtonComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Avo::Index::Ordering::ButtonComponent
- Defined in:
- app/components/avo/index/ordering/button_component.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#reflection ⇒ Object
Returns the value of attribute reflection.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#svg ⇒ Object
Returns the value of attribute svg.
Instance Method Summary collapse
-
#initialize(resource:, direction:, svg: nil, reflection: nil) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
- #order_path(args) ⇒ Object
- #render? ⇒ Boolean
Constructor Details
#initialize(resource:, direction:, svg: nil, reflection: nil) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
9 10 11 12 13 14 |
# File 'app/components/avo/index/ordering/button_component.rb', line 9 def initialize(resource:, direction:, svg: nil, reflection: nil) @resource = resource @reflection = reflection @direction = direction @svg = svg end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
6 7 8 |
# File 'app/components/avo/index/ordering/button_component.rb', line 6 def direction @direction end |
#reflection ⇒ Object
Returns the value of attribute reflection.
5 6 7 |
# File 'app/components/avo/index/ordering/button_component.rb', line 5 def reflection @reflection end |
#resource ⇒ Object
Returns the value of attribute resource.
4 5 6 |
# File 'app/components/avo/index/ordering/button_component.rb', line 4 def resource @resource end |
#svg ⇒ Object
Returns the value of attribute svg.
7 8 9 |
# File 'app/components/avo/index/ordering/button_component.rb', line 7 def svg @svg end |
Instance Method Details
#order_path(args) ⇒ Object
20 21 22 |
# File 'app/components/avo/index/ordering/button_component.rb', line 20 def order_path(args) Avo::App.view_context.avo.reorder_order_path(resource.route_key, resource.model.to_param, **args) end |
#render? ⇒ Boolean
16 17 18 |
# File 'app/components/avo/index/ordering/button_component.rb', line 16 def render? order_actions[direction].present? end |