Class: Warb::Components::CTAAction
- Inherits:
-
Object
- Object
- Warb::Components::CTAAction
- Defined in:
- lib/warb/components/action.rb
Instance Attribute Summary collapse
-
#button_text ⇒ Object
Returns the value of attribute button_text.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(button_text: nil, url: nil) ⇒ CTAAction
constructor
A new instance of CTAAction.
- #to_h ⇒ Object
Constructor Details
#initialize(button_text: nil, url: nil) ⇒ CTAAction
Returns a new instance of CTAAction.
109 110 111 112 |
# File 'lib/warb/components/action.rb', line 109 def initialize(button_text: nil, url: nil) @button_text = @url = url end |
Instance Attribute Details
#button_text ⇒ Object
Returns the value of attribute button_text.
107 108 109 |
# File 'lib/warb/components/action.rb', line 107 def @button_text end |
#url ⇒ Object
Returns the value of attribute url.
107 108 109 |
# File 'lib/warb/components/action.rb', line 107 def url @url end |
Instance Method Details
#to_h ⇒ Object
114 115 116 117 118 119 120 121 122 |
# File 'lib/warb/components/action.rb', line 114 def to_h { name: 'cta_url', parameters: { display_text: @button_text, url: @url } } end |