Class: Warb::Components::CopyCodeButton
- Defined in:
- lib/warb/components/copy_code_button.rb
Constant Summary collapse
- BUTTON_TYPE =
'copy_code'
Instance Attribute Summary collapse
-
#coupon_code ⇒ Object
Returns the value of attribute coupon_code.
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
#coupon_code ⇒ Object
Returns the value of attribute coupon_code.
8 9 10 |
# File 'lib/warb/components/copy_code_button.rb', line 8 def coupon_code @coupon_code end |
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/warb/components/copy_code_button.rb', line 10 def to_h = super if coupon_code || @params[:coupon_code] [:parameters] = Array.new(1, { type: 'coupon_code', coupon_code: coupon_code || @params[:coupon_code] }) end end |