Class: Messenger::Elements::Bubble
- Inherits:
-
Object
- Object
- Messenger::Elements::Bubble
- Includes:
- Components::Element
- Defined in:
- lib/messenger/components/elements/bubble.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#item_url ⇒ Object
Returns the value of attribute item_url.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #build_buttons(buttons) ⇒ Object
-
#initialize(title:, subtitle: nil, item_url: nil, image_url: nil, buttons: nil) ⇒ Bubble
constructor
A new instance of Bubble.
Methods included from Components::Element
Constructor Details
#initialize(title:, subtitle: nil, item_url: nil, image_url: nil, buttons: nil) ⇒ Bubble
Returns a new instance of Bubble.
10 11 12 13 14 15 16 |
# File 'lib/messenger/components/elements/bubble.rb', line 10 def initialize(title:, subtitle: nil, item_url: nil, image_url: nil, buttons: nil) @title = title @subtitle = subtitle @image_url = image_url @item_url = item_url @buttons = () end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
8 9 10 |
# File 'lib/messenger/components/elements/bubble.rb', line 8 def @buttons end |
#image_url ⇒ Object
Returns the value of attribute image_url.
8 9 10 |
# File 'lib/messenger/components/elements/bubble.rb', line 8 def image_url @image_url end |
#item_url ⇒ Object
Returns the value of attribute item_url.
8 9 10 |
# File 'lib/messenger/components/elements/bubble.rb', line 8 def item_url @item_url end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/messenger/components/elements/bubble.rb', line 8 def title @title end |
Instance Method Details
#build_buttons(buttons) ⇒ Object
18 19 20 |
# File 'lib/messenger/components/elements/bubble.rb', line 18 def () .map { || .build } if .present? end |