Class: Warb::Components::FlowButton
- Defined in:
- lib/warb/components/flow_button.rb
Constant Summary collapse
- BUTTON_TYPE =
'flow'
Instance Attribute Summary collapse
-
#flow_action_data ⇒ Object
Returns the value of attribute flow_action_data.
-
#flow_token ⇒ Object
Returns the value of attribute flow_token.
Attributes inherited from Button
Instance Method Summary collapse
Methods inherited from Button
Methods inherited from Component
Constructor Details
This class inherits a constructor from Warb::Components::Button
Instance Attribute Details
#flow_action_data ⇒ Object
Returns the value of attribute flow_action_data.
8 9 10 |
# File 'lib/warb/components/flow_button.rb', line 8 def flow_action_data @flow_action_data end |
#flow_token ⇒ Object
Returns the value of attribute flow_token.
8 9 10 |
# File 'lib/warb/components/flow_button.rb', line 8 def flow_token @flow_token end |
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/warb/components/flow_button.rb', line 10 def to_h = super token = flow_token || @params[:flow_token] data = flow_action_data || @params[:flow_action_data] action = {} action[:flow_token] = token if token action[:flow_action_data] = data if data [:parameters] = [{ type: 'action', action: action }] end |