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