Class: Jav::Index::Ordering::ButtonComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Jav::Index::Ordering::ButtonComponent
- Defined in:
- app/components/jav/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.
6 7 8 9 10 11 |
# File 'app/components/jav/index/ordering/button_component.rb', line 6 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.
4 5 6 |
# File 'app/components/jav/index/ordering/button_component.rb', line 4 def direction @direction end |
#reflection ⇒ Object
Returns the value of attribute reflection.
4 5 6 |
# File 'app/components/jav/index/ordering/button_component.rb', line 4 def reflection @reflection end |
#resource ⇒ Object
Returns the value of attribute resource.
4 5 6 |
# File 'app/components/jav/index/ordering/button_component.rb', line 4 def resource @resource end |
#svg ⇒ Object
Returns the value of attribute svg.
4 5 6 |
# File 'app/components/jav/index/ordering/button_component.rb', line 4 def svg @svg end |
Instance Method Details
#order_path(args) ⇒ Object
17 18 19 |
# File 'app/components/jav/index/ordering/button_component.rb', line 17 def order_path(args) Jav::App.view_context.jav.reorder_order_path(resource.route_key, resource.model.to_param, **args) end |
#render? ⇒ Boolean
13 14 15 |
# File 'app/components/jav/index/ordering/button_component.rb', line 13 def render? order_actions[direction].present? end |